Write Multiple files in a single CURL request

前端 未结 3 1372
無奈伤痛
無奈伤痛 2020-12-17 03:29

Is there a way using PHP curl to send multiple files in a single request?

I understand you can send a single file making use of the following:

$fh =          


        
3条回答
  •  情歌与酒
    2020-12-17 03:50

    You can use this

    $post = array(
         "file1"=>"@/path/to/myfile1.jpg",
         "file2"=>"@/path/to/myfile2.jpg",
    );
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
    

提交回复
热议问题