PHP Curl Batch upload, and with post other forms, a single upload can be with the post, can be batch of words, there is no way?
'Foo', 'file'=>$file); //多文件上传为什么不能再传其它post//变成//$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 给改成 true了, 弄回去
How can the final run result be like a form, and what $_FILES
$_POST
?
Single file is OK, but a lot of files are not, how to do?
Reply content:
PHP Curl Batch upload, and with post other forms, a single upload can be with the post, can be batch of words, there is no way?
'Foo', 'file'=>$file); //多文件上传为什么不能再传其它post//变成//$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 给改成 true了, 弄回去
How can the final run result be like a form, and what $_FILES
$_POST
?
Single file is OK, but a lot of files are not, how to do?
I remember it was necessary to give a filename. The array could not be passed past. Only key can be specified.
$postfileds = [ 'file1' => CURLFile(xxxxx 'file2' => CURLFile(xxxxxxx # 一定要用数组那也一定要这么写 'file[]' => CURLFile(xxxxxx 'file[]' => CURLFile(xxxxx];
Set the File_path as an array loop execution