Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem and solution uploading files PHP 7+ #19

Open
karelVanGeerdeghom opened this issue Oct 26, 2017 · 0 comments
Open

Problem and solution uploading files PHP 7+ #19

karelVanGeerdeghom opened this issue Oct 26, 2017 · 0 comments

Comments

@karelVanGeerdeghom
Copy link

karelVanGeerdeghom commented Oct 26, 2017

"As of PHP 5.6 @$filePath will not work in CURLOPT_POSTFIELDS without CURLOPT_SAFE_UPLOAD being set and it is completely removed in PHP 7."
https://stackoverflow.com/questions/21905942/posting-raw-image-data-as-multipart-form-data-in-curl

The solution is to rewrite line 45 in vendor/activecollab/activecollab-sdk/ActiveCollab/Connectors/Curl.php:
// $post_data['attachment_' . $counter++] = '@' . $file . ';type=application/octet-stream';
$post_data['attachment_' . $counter++] = new \CURLFile($file, mime_content_type($file));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant