[ACCEPTED]-How to use PHP cURL to send images with the correct Content-Type?-curl
Accepted answer
Use the CURLOPT_HTTPHEADER option:
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: image/jpeg"));
So specify 2 Content-Type headers specifically for file 1 uploads, use:
$params = array('name'=>'@D:\globe.jpg;type=image/jpeg');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.