Discuss Dropbox Developer & API
Hi,
I currently develop Android app for user to upload their files to Dropbox. My app can upload <300MB file to user's Dropbox account. But large file is failed all the times.
My development environment is Windows 10 and use Android Studio IDE. I had updated dropbox SDK version to 3.1.1 in Gradle build. And refered to official sample code as below:
DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder("APP Name")
.build();
mDbxClient = new DbxClientV2(requestConfig, accessToken);
Then I see the log "com.dropbox.core.BadResponseCodeException: unexpected HTTP status code: 413: null" when error happened. Please help me to fix this issue. Thanks!
When using the individual upload method, only files up to 150 MB are officially supported. Attempting to upload larger files, above 300 MB as you found, will fail with that error.
To upload files larger than 150 MB, you'll need to use upload sessions, via uploadSessionStart, uploadSessionAppendV2, and uploadSessionFinishBatch. Please refer to the documentation for those methods for more information. There's also an example here.
When using the individual upload method, only files up to 150 MB are officially supported. Attempting to upload larger files, above 300 MB as you found, will fail with that error.
To upload files larger than 150 MB, you'll need to use upload sessions, via uploadSessionStart, uploadSessionAppendV2, and uploadSessionFinishBatch. Please refer to the documentation for those methods for more information. There's also an example here.
Hi Greg,
Thank you first.
I have a question about CHUNKED_UPLOAD_CHUNK_SIZE. In sample code, it has a description "Use a multiple of 4MiB for your chunk size". My question is can I set this value smaller than 4MB? Is 32KB ok?
Thanks!!
That link seems to be wrong. Could you please provide it again?
Thanks!!
@SWworker The CHUNKED_UPLOAD_CHUNK_SIZE value determines how much data to send per individual upload session request, and we recommend using a multiple of 4 MiB due to how the Dropbox backend is implemented.
You can specify a smaller value than 4 MiB, but that generally isn't recommended. That would significantly increase how many requests are needed for the upload session, increasing overhead, and decreasing overall transfer speed. That would only be advantageous in the case where you know the network connection is extremely unreliable, so that retry attempts wouldn't need to re-upload as much.
Otherwise, we recommend something bigger, such as 8 MiB or 12 MiB.
Also, that other post with the link appeared to just be spam. I've removed it accordingly.
Hi there!
If you need more help you can view your support options (expected response time for a 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!