$file = new \CURLFile($real_path);
$file_info = array(
'filename' => '$img',
'content-type' => 'image/jpg',
'filelength' => filesize($real_path)
);
$data= array("media"=>$file,'form-data'=>$file_info);
curl_setopt($ch1, CURLOPT_URL, $url);
curl_setopt($ch1, CURLOPT_POST, 1);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch1, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch1);
return $result;
请问楼主有解决这个问题吗
文档上有标题字段吗