Skip to content

Commit

Permalink
php upload file within 5.5 with deprecated @ method
Browse files Browse the repository at this point in the history
  • Loading branch information
Helperhaps committed Jan 24, 2018
1 parent 08fb134 commit 04f3666
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
@@ -1,7 +1,7 @@
{
"name": "jiguang/jmessage",
"type": "library",
"version": "1.1.8",
"version": "1.1.9",
"description": "JMessage's officially supported PHP client library for accessing JMessage APIs.",
"keywords": ["jiguang", "jmessage", "API Client"],
"homepage": "https://github.com/jpush/jmessage-api-php-client",
Expand Down
3 changes: 1 addition & 2 deletions src/JMessage/Http.php
Expand Up @@ -77,11 +77,10 @@ private static function request($client, $method, $uri, array $body = [], array
$options[CURLOPT_SAFE_UPLOAD] = true;
$options[CURLOPT_POSTFIELDS] = ['filename' => new \CURLFile($body['path'])];
} else {
# TODO
if (defined('CURLOPT_SAFE_UPLOAD')) {
$options[CURLOPT_SAFE_UPLOAD] = false;
$options[CURLOPT_POSTFIELDS] = '';
}
$options[CURLOPT_POSTFIELDS] = ['filename' => '@' . $body['path']];
}
} else {
$options[CURLOPT_POSTFIELDS] = json_encode($body);
Expand Down

0 comments on commit 04f3666

Please sign in to comment.