how to send payload request using php cURL?
I try to upload a file to the server where the files are stored for free, and when sending the file, I donβt accept it, and I redirect to the error page, and when I do this from my Interfas, I see how the files are sent in the code inspector
How do I install cURL php for a file server, gets me as if the browser?
Payload Request
------ WebKitFormBoundary0cHZePmuSA0mtcdO
Content-Disposition: form-data; name = "files []"; file name = "vlcsnap-2015-07-17-22h57m13s909.png" Content-Type: image / png
------ WebKitFormBoundary0cHZePmuSA0mtcdO -
$ch = curl_init(); $ch_file = new CURLFile( $tmp_name, $type, $name ); $data = array("files[]"=>$ch_file); curl_setopt($ch, CURLOPT_URL, "http://url_site.com"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch);
source share