PHP CURL POST 多个文件

//客户端
$param = array(
   'file1' => curl_file_create('c:/test.pdf'),
   'file2' => curl_file_create('c:/test.doc'),
   'abc' => '12345fsdjfk',
);
$url = 'ssl.siophan.com/agent/v1/order/add';
$ch = curl_init($url); 
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE);//避免ssl url 提交失败问题
$result = curl_exec($ch);
print_r($result );

//服务器端
$file = $_FILES;
$post = $_POST



 
  

你可能感兴趣的:(php,curl)