-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
When having a PHP version >= 5.5 (which all production env should have at this point), we end on line 101 for uploading an attachment.
Not setting the mime_type is quite annoying for daily usage in ActiveCollab, which can open images et.al. inlined. When mime_type becomes octet-stream, you have to download them first.
Fast Solution
CURLFile also takes in mime as a second parameter.
https://www.php.net/curlfile
in src/Connector line 101:
$post_data['attachment_' . $counter++] = new CURLFile($path);
should be:
$post_data['attachment_' . $counter++] = new CURLFile($path, $mime_type);
It could also be nice to have a small tutorial on upload-files:
$response = $client->post(
'upload-files',
[],
[[ "/tmp/filename.jpg", mime_content_type("/tmp/filename.jpg') ]]
);
print ($response->getJson());
saruman
Metadata
Metadata
Assignees
Labels
No labels