Jump to content

Edit History

sebma

sebma


Add code

Hello, did anyone manage to upload the attachments in 1.7.8? i try curl, i get code 200, no attachment

My code:

url = 'http://xxxxxx/api/attachments/';
$key  = 'xxxxxx';
$args['file'] = new CurlFile($att_path);
$args['file_name'] = 'file_name';
$args['mime'] = 'image/jpeg';
$args['name'] = 'name';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_USERPWD, $key.':');
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch);
curl_close($ch);

 

sebma

sebma

Hello, did anyone manage to upload the attachments in 1.7.8? i try curl, i get code 200, no attachment

×
×
  • Create New...