当然你的php.ini开启了curl扩展功能
1、文件上传
/**
* 以文件上传 第二种方法
*/
public function upload(){...$filename
);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt...($ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HEADER..., false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$return_data = curl_exec($ch);...curl_close($ch);
echo $return_data;
}
2、文件接收端(不限定于PHP)
/**
* 接收文件
*/
public function