I have this application where from a web page the user uploads a file, what i need to do is that the application sends this file to another API.
Now i don't care what happens or what response i get after doing the cURL request because it takes too long to process. i only notify the user that his/her file was uploaded correctly.
my code:
curl_setopt_array( $ch, [ CURLOPT_VERBOSE=>true, CURLOPT_RETURNTRANSFER => true, CURLOPT_URL => $this->endpoint, CURLOPT_POSTFIELDS => $this->payload, ] ); curl_exec($ch); $this->endpoint contains the url and $this->payload the file received. From the API i sent that file i get the message that no file was sent or the file is in a incorrect format. My guess is that i'm not sending the file correctly when executing the command. How to i can send that file?
curlfunctions of PHP? You can't usecurl_getinfo()withexec().exec()waits for the response.