cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting error while uploading larger files using php dropbox api

Getting error while uploading larger files using php dropbox api

Srinivas R.1
New member | Level 1

Hi There,

We have used PHP Dropbox API
to upload files to Dropbox account. But while uploading larger files (500MB from localhost (apache)) we are getting the following errors.

Can you please look into this and help me out on this ASAP.

Error

Fatal error: Uncaught exception 'DropboxException' with message 'cURL-Error (56): SSL read: error:00000000:lib(0):func(0):reason(0), errno 10053' in D:\wamp\www\dropbox_api\DropboxClient.php on line 534

Please help us ASAP. Thanks for your help in advance.

 

Thanks,

Srinivas Reddy .A

 

 

27 Replies 27

Srinivas R.1
New member | Level 1

Thanks Steve, can I change the "$DEFAULT_CHUNK_SIZE" value to some high than 4MB, is that works if I change that value.

Steve M.
Dropbox Staff

I recommend using https://dropbox.github.io/dropbox-sdk-php/api-docs/v1.1.x/class-Dropbox.Client.html#_uploadFileChunk.... You can specify the chunk size you want there.

Srinivas R.1
New member | Level 1

What is the maximum size we can give, is there any limit for that value.

Steve M.
Dropbox Staff

From https://www.dropbox.com/developers-v1/core/docs#chunked-upload:

"Chunks can be any size up to 150 MB."

Srinivas R.1
New member | Level 1

Hi Steve,

I am using while uploading a video using uploadFileChunked() method but we got the below error. Can you please help me on this.

Fatal error: Uncaught exception 'InvalidArgumentException' with message ''inStream' has bad type; expecting resource, got boolean' in /var/www/vhosts/dev.loveu.evanmarckatz.com/dropbox_api/lib/Dropbox/Checker.php:22 Stack trace: #0 /var/www/vhosts/dev.loveu.evanmarckatz.com/dropbox_api/lib/Dropbox/Checker.php(27): Dropbox\Checker::throwError('inStream', false, 'resource') #1 /var/www/vhosts/dev.loveu.evanmarckatz.com/dropbox_api/lib/Dropbox/Client.php(377): Dropbox\Checker::argResource('inStream', false) #2 /var/www/vhosts/dev.loveu.evanmarckatz.com/testimonialSubmit.php(130): Dropbox\Client->uploadFileChunked('/Wildlife.wmv', Object(Dropbox\WriteMode), false, NULL, 52428800) #3 {main} thrown in /var/www/vhosts/dev.loveu.evanmarckatz.com/dropbox_api/lib/Dropbox/Checker.php on line 22 

The file size is 25MB but we received the above error. Please help me on this ASAP.

Code here: http://www.codesend.com/view/874cccb8c6723e9a92f9f323c612594d/

 

Thanks,

Srinivas Reddy .A

 

Greg-DB
Dropbox Staff

The error message is: "'inStream' has bad type; expecting resource, got boolean'". That's indicating that $inStream, the third parameter to uploadFileChunked, per the documentation, which is supposed to be a resource, was actually a boolean. In your code, you're giving the variable $f for that parameter, so you should check why that isn't the type you're expecting.

You're getting your $f via fopen, and the documentation for that says:

"Returns a file pointer resource on success, or FALSE on error."

So, it's likely that fopen is failing with some error that you need to handle/resolve, causing to $f to be false.

Greg-DB
Dropbox Staff

By the way, for the sake of security, you should disable that access token now that you've shared it publicly. You can do so by revoking access to the app entirely, if the access token is for your account, here:

https://www.dropbox.com/account/security

Or, you can disable just this access token using the /disable_access_token endpoint:

https://www.dropbox.com/developers/core/docs#disable-token

Srinivas R.1
New member | Level 1

Thanks Greg, the issue is from my side and there is limit to upload file to 5MB max size. But I am uploading 25MB file, so its giving error. Finally we increased the size and its working as expected.

Also, we have disabled the token and using the new token.

Thanks

Srinivas Reddy.A

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Srinivas R.1 New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Steve M. Dropbox Staff
What do Dropbox user levels mean?