Hi,
I'm build an webapp API that receives an image file from users using post forms and need to send this image to another server/application where it'll be processed.
I'm trying do to this using cURL, but on L5 all I can get is an error when I try to load the new CurlFile class from php-curl
new CurlFile($file_path,'file/exgpd',$file_name);
The error I got is:
Class 'App\Http\Controllers\CurlFile' not found
I believe this happens because of namespaces but I don't have a clue on how to deal with it.
Can anyone helpme with this?
thanks!
Don't know why, but I just tried to call the php class using a ' \ ' before and it just worked…
So for anyone with the same problem, use:
new \CurlFile($file_path,'file/exgpd',$file_name);
it worked as expected.
the class CurlFile is from the Curl extension. They need to be called with a \CurlFile because you're calling it from the App\Http\Controllers namespace.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community