Image Upload Using php - curl

前端 未结 2 1878
忘掉有多难
忘掉有多难 2020-12-18 13:29

We are struggling to automatically upload images using php - curl. Please let me know if there is any way to do the same.

2条回答
  •  星月不相逢
    2020-12-18 13:54

    the basic idea

    
        $post = array(
            "file_box"=>"@/path/to/myfile.jpg",
            "username"=>"foobar",
            "password"=>"secret",
            "submit"=>"submit"
        );
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
        $response = curl_exec($ch);
    ?>
    

    you can have more info about curl here.

提交回复
热议问题