-
Notifications
You must be signed in to change notification settings - Fork 131
Expecting a file upload (Status Code: 400) #67
Comments
Hi @Blacx The fatal error is due to Dropbox returning an object as the error message. I have submitted a ticket to Dropbox as The Exception thrown suggests no file was uploaded but I have not seen this since the very early days of testing the API and getting cURL to prepare the POST request as required. Is this problem apparent if you use a 'permanent' file that is on your system? I spent half an hour on my lunch break trying to replicate this issue but no luck so far. @henrylevak (sorry to drag you in) - As you did have the same problem with the previous issue are you able to confirm if this problem also affects you? |
@Blacx I'll test it when I get home tonight - I was able to successfully upload files earlier this week - but I'll try it later tonight as well. |
@benthedesigner : ex: @henrylevak : I hope it help me. |
I do have confirmation from Dropbox that the API returns error messages inconsistently... Useful! This is being looked at by their team, but I'm told the likelihood is that this behaviour won't be changed in version 1 of the API. I'm still unable to replicate the error with uploading files but have addressed the code that was triggering the fatal in commit 5bbf95b. @henrylevak - Thanks I'll await your reply. |
Sorry to disappoint all but I haven't had any time to check on this. I had to finish a feature last night and ran out of time . I'll try again tonight :( |
No problem! @Blacx - Can you advise if this problem occurs for all uploads or just some of them? |
So I used @Blacx 's code and had no problems what so ever.. putFile($tmp, 'api_upload_test1.txt'); unlink($tmp); var_dump($put); } catch (\Dropbox\Exception $e) { var_dump($e); } This uploaded the file perfectly... |
Same for me @henrylevak. I'll need to get a 5.3.1 install up and running to see if I can replicate. |
Hi @benthedesigner only putFile.php is problematic for me, the other work normally even putStream.php also work well. And thank you @henrylevak to try and provide information. |
Hi @Blacx I'm unable to replicate this issue under 5.3.1. It's very strange that this only affects the putFile method, too. Can you advise if the problem persists and if you've found out any more about the issue? |
Hi @benthedesigner, I was trying to execute putFile in PHP 5.3.18 and the result goes perfectly. But it's weird and still not be another clue to run it in PHP 5.3.1. Still trying to solve the problem while waiting for a solution. |
Hi @Blacx, Unfortunately I'm still unable to replicate this. Do you have any more information about what might be causing the issue? |
Hi @benthedesigner, I do not have a solution as well. While I still think that the error occurred because of PHP version 5.3.1 that I use. |
PHP 5.3.1 does meet the minimum requirement and all code to date is tested under that version. I'll leave this issue open so others can comment if they experience the same issue. Sorry I can't help more on this occasion. |
I was running php 5.6.2 |
I faced same problem. i was running php 5.6.10 I found the answer . There is a new Variable included with curl in PHP 5.5: CURLOPT_SAFE_UPLOAD this is set to false by default in PHP 5.5 and is switched to a default of true in PHP 5.6. I have set CURLOPT_SAFE_UPLOAD = false in 79ea42d It has fixed my problem. |
not work. Expecting a file upload ... |
Dear @benthedesigner ,
I'm having an error when running putFile.php.
The error message that appears is as follows:
Catchable fatal error: Object of class stdClass could not be converted to string in C:\xampp\htdocs\dropbox\new\Dropbox\OAuth\Consumer\Curl.php on line 103
But I tried to change
$response['body']->error
on \Dropbox\OAuth\Consumer\Curl.php file at line 103 be as follows:$message = $response['body']->error->file . ' (Status Code: ' . $response['code'] . ')';
And the exception that appears now is "Expecting a file upload".
Here is the putFile.php which I modified:
Here is the output:
The text was updated successfully, but these errors were encountered: