时间:2021-07-01 10:21:17 帮助过:6人阅读
$file = realpath('gif/1.gif'); //要上传的文件
$fields['f'] = '@'.$file;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"你的api接口");
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_exec ($ch);
curl_close ($ch);