Phpcurl batch uploads with other forms of post. A single upload can be combined with post. If it can be batch uploaded, it won't work. Is there any way? How can the final running result of {code...} be like a form with $ _ FILES and $ _ POST? A single file is acceptable, but there are many... php curl batch upload with other forms of post. A single upload can be combined with post. If it can be batch uploaded, it won't work. Is there any way?
'Foo', 'file' => $ file); // Why can't I upload multiple files? // convert to/$ data = $ file; curl_setopt ($ ch, CURLOPT_URL, 'HTTP: // localhost/upload. php '); curl_setopt ($ ch, CURLOPT_POST, 1); if (class_exists (' \ CURLFile ') {curl_setopt ($ ch, CURLOPT_SAFE_UPLOAD, true );} else {if (defined ('curlopt _ SAFE_UPLOAD ') {curl_setopt ($ ch, CURLOPT_SAFE_UPLOAD, false); // 5.6 is set to true, get back} curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ data); curl_e Xec ($ ch); // close the cURL resource and release the system resource curl_close ($ ch);?>
How can the final running result be like a form?$_FILES
Youyou$_POST
What about it?
A single file is acceptable, but multiple files cannot. What should I do?
Reply content:
Php curl batch upload with other forms of post. A single upload can be combined with post. If it can be batch uploaded, it won't work. Is there any way?
'Foo', 'file' => $ file); // Why can't I upload multiple files? // convert to/$ data = $ file; curl_setopt ($ ch, CURLOPT_URL, 'HTTP: // localhost/upload. php '); curl_setopt ($ ch, CURLOPT_POST, 1); if (class_exists (' \ CURLFile ') {curl_setopt ($ ch, CURLOPT_SAFE_UPLOAD, true );} else {if (defined ('curlopt _ SAFE_UPLOAD ') {curl_setopt ($ ch, CURLOPT_SAFE_UPLOAD, false); // 5.6 is set to true, get back} curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ data); curl_e Xec ($ ch); // close the cURL resource and release the system resource curl_close ($ ch);?>
How can the final running result be like a form?$_FILES
Youyou$_POST
What about it?
A single file is acceptable, but multiple files cannot. What should I do?
I remember to give a file name. The array cannot be passed. Only keys can be specified.
$ Postfileds = ['file1' => CURLFile (xxxxx 'file2' => CURLFile (xxxxxxx # Be sure to use an array, then write 'file [] '=> CURLFile (xxxxxx 'File [] '=> CURLFile (xxxxx];
Set file_path to an array for loop execution