You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
EconoSist
5 years agoExplorer | Level 3
API V2 Upload File size above 300MB
I was using Upload v2 API in PHP by curl, but the file limit is around 300MB, when i try to upload a larger file than that, it fails. Reading forums, docs, i found a useful thing. Use Sessions Uploa...
Greg-DB
5 years agoDropbox Staff
Yes, as you found, since the /2/files/upload endpoint only officially supports uploading files up to 150 MB in size, you should use "upload sessions" to upload larger files. You can find the documentation for the upload session endpoints here:
We don't offer an official PHP SDK or PHP code samples, but the documentation there includes curl examples you can translate for your language and HTTP client. There's also a Java code sample using upload sessions here. That's written for the Java SDK, but the logic should still be useful as an example.
Anyway, you're correct that after you "start" the upload session, the next step is to "append" more data to it. Note that the /2/files/upload_session/append_v2 endpoint doesn't actually have a return value. That is, if the call succeeds, it doesn't return any other information.
You should first check the returned status code (which appears to be '$http_code' in your code.) If it responds with a 200 status code, it means that the operation succeeded. (It would respond with a non-200 status code, optionally with a more specific error in the response body, depending on the type of failure, if it failed.)
- EconoSist5 years agoExplorer | Level 3
I know that you dont offer an offical SDK for PHP.
In the "Start" i have to send the file too? i have to split my file in smalls parts? What i have to do? Where i split my file? i have to call append multiple times?
Yes my HTTP code returns 200.
- Greg-DB5 years agoDropbox Staff
Yes, the upload session endpoints allow you to upload a large file by sending it in multiple pieces. (Each piece can be up to 150 MB in size, but something smaller, such as 8 MB, is recommended.) You should send the pieces in order, and you can optionally send them to any of the three endpoints. That is, you can include the first piece of data with the start request, but you are not required to. You can make as many additional calls to the append endpoint as is necessary to upload the entire file. I recommend checking this example to see the flow.
Anyway, if you're getting a 200 status code, that means that the call succeeded and whatever data you sent was appended to the upload session. (I don't actually see where you're setting the data in your code though. It looks like you're just sending an empty string via 'CURLOPT_POSTFIELDS', so you'll need to update that to send the chunk of the file.)
- EconoSist5 years agoExplorer | Level 3
Thanks for your reply, my problem is in Chunks, i dont know how to do it in the correct way, i've been looking in forums and docs, to make it works, but i am stuck in this process.
IF someone can help me, would be grateful
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 11 days ago
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 or Facebook.
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!