{"error_msg":"文件类型不是文本文件
晓曈老爸 发布于2021-08 浏览:432 回复:1
0
收藏

public function curl(){
$file = new \CURLFile('/www/wwwroot/appBackstage/public/unit_task_flow/taskflow_S55773_160519.json');
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://aip.baidubce.com/file/2.0/unit/v3/taskflow/import',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => array(
'Content-Type: multipart/form-data'
),
CURLOPT_POSTFIELDS =>
array('serviceId' => 'S55773',
'file'=> $file,
'access_token' => '24.535e6595370ef7222aa050b5c115b9b0.2592000.1630742949.282335-24615339'),
));
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
exit;
}

收藏
点赞
0
个赞
共1条回复 最后由unit_internal9回复于2021-08
#2unit_internal9回复于2021-08

之前其他途径处理过

0
TOP
切换版块