cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Check out the Dropbox cheat sheet for getting started in 2021 here!

Discuss Dropbox Developer & API

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

Develop Android app to upload large file to Dropbox. Failed all the times.

Develop Android app to upload large file to Dropbox. Failed all the times.

Explorer | Level 4

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!

1 Accepted Solution

Accepted Solutions

Re: Develop Android app to upload large file to Dropbox. Failed all the times.

Dropboxer

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 uploadSessionStartuploadSessionAppendV2, and uploadSessionFinishBatch. Please refer to the documentation for those methods for more information. There's also an example here.

View solution in original post

4 Replies 4

Re: Develop Android app to upload large file to Dropbox. Failed all the times.

Dropboxer

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 uploadSessionStartuploadSessionAppendV2, and uploadSessionFinishBatch. Please refer to the documentation for those methods for more information. There's also an example here.

View solution in original post

Re: Develop Android app to upload large file to Dropbox. Failed all the times.

Explorer | Level 4

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!!

Re: Develop Android app to upload large file to Dropbox. Failed all the times.

Explorer | Level 4

That link seems to be wrong. Could you please provide it again? 

Thanks!!

Re: Develop Android app to upload large file to Dropbox. Failed all the times.

Dropboxer

@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.

Polls
Are you starting new work habits this year?

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?