Skip to content

Problem and solution uploading files PHP 7+  #19

@karelVanGeerdeghom

Description

@karelVanGeerdeghom

"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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions