Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
vibh
7 years agoExplorer | Level 3
API V2 Upload Limit
Hi, I am trying to upload the file to Dropbox using API v2 in PHP using curl. I am getting a 413 error response from the Dropbox server (Request entity too large). So what is the limit to upl...
Greg-DB
Dropbox Community Moderator
7 years agoIt sounds like you're using /2/files/upload. That endpoint does have a file size limit of 150 MB.
For larger files, you should use upload sessions instead.
This works the same way for both paid and free accounts.
- vibh7 years agoExplorer | Level 3
Hi Greg,
Thanks for your response. please suggest how to use session with the curl in PHP.
An example of the same would be great because I am not able to implement it correctly after so many trials.
I changed my API URL: https://content.dropboxapi.com/2/files/upload_session/start
it gives "error in call to API function"
this is my header code
$headers = array('Authorization: Bearer ' . $token,
'Content-Type: application/octet-stream',
'Dropbox-API-Arg: ' .
json_encode(
array(
"path" => '/' . basename($destPath . $to_zip_folder),
"mode" => "add",
"autorename" => true,
"mute" => false
)
),
'Content-Type: application/octet-stream'
);Thanks in advance.
- Greg-DB7 years ago
Dropbox Community Moderator
I don't have a sample implementation for using upload sessions in PHP unfortunately.
Can you print out the full HTTP response body you're getting? It should contain a more detailed error message indicating the issue. If you still need help, please also share the code you have so far so I can take a look, in addition to the full error.- thelwang7 years agoHelpful | Level 7
vibh,
You seem to be doing things all yourself with curl. It might be easier for you to use some PHP bindings to the Dropbox API that someone else has made.
There doesn't seem to be an official Dropbox PHP binding, but this looks popular and sort of active on github: https://github.com/kunalvarma05/dropbox-php-sdk
You can see it uses upload sessions so that you can upload files larger than 100MB piece by piece://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Dropbox.php#L780
To install it, full their instructions here. You might first have to install php composer to use this though, documentation for that is here.
If you're getting stuck on implementing an API just from the HTTP spec...I'd really recommend using an SDK since you'll likely just continue to have problems as you start using other Dropbox API features.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!