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: 

File Upload Limit

File Upload Limit

ShiminCai
Helpful | Level 6
Go to solution

Hi there,

 

In our iOS app we are uploading files to our Dropbox with this Swift method:

 

func upload(_ destinationPath: String, fileUrl: URL, completion: @escaping (Bool) -> Void) {

        client.files.upload(path: destinationPath, input: fileUrl)

            .response { response, error in

                if error != nil {

                    print(error?.description)

                }

                if let response = response {

                    completion(true)

                } else {

                    print(error)

                    completion(false)

                }

                DispatchQueue.main.async {

                    SVProgressHUD.dismiss()

                }

            }

            .progress { progressData in

                let completedUnitCount = Float(progressData.completedUnitCount)

                let totalUnitCount = Float(progressData.totalUnitCount)

                let progress = completedUnitCount / totalUnitCount

                DispatchQueue.main.async {

                    SVProgressHUD.show(withStatus: "Uploading Plan documents to dropbox...\n\(Int(progress * 100))% completed")

                }

            }

}

It's been working fine until now...

 

One of our users was uploading a big file (521.5 mb) and encountered an uploading failure error at last moment having reached 100% upload. The Dropbox API threw this error and as a result no file was uploaded:

Screen Shot 2022-04-05 at 4.48.32 pm.png

 

However, uploading works fine with smaller files. Just wondering if there is any file size upload limit in Dropbox?  How could we fix the upload failure? Your help is much appreciated.

 

Cheers,

 

Shimin

 

 

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

Hi @ShiminCai,

There isn't file size limit (there is actually but it's big enough, so doesn't matter), but it's a single transaction limit - not guaranteed more than 150MB. As can be seen in your code you are using single transaction upload only. Is it so, or just something is missing in your post. In such a case you are setting implicit limitation from transaction size to the file size! You can use upload sessions for bigger files, so to spread upload to multiple transactions (every one smaller than 150MB). 😉

Hope this helps.

View solution in original post

3 Replies 3

Здравко
Legendary | Level 20
Go to solution

Hi @ShiminCai,

There isn't file size limit (there is actually but it's big enough, so doesn't matter), but it's a single transaction limit - not guaranteed more than 150MB. As can be seen in your code you are using single transaction upload only. Is it so, or just something is missing in your post. In such a case you are setting implicit limitation from transaction size to the file size! You can use upload sessions for bigger files, so to spread upload to multiple transactions (every one smaller than 150MB). 😉

Hope this helps.

Greg-DB
Dropbox Staff
Go to solution

@ShiminCai Yes, as Здравко mentioned, the upload method only officially supports uploading files up to 150 MB in size. For larger files, like the "521.5 mb" file you mentioned, you will need to use "upload sessions".

ShiminCai
Helpful | Level 6
Go to solution

Hi @Greg-DB,

 

Upload sessions worked. I found the Swift sample using upload sessions you posted in another discussion thread, which worked a treat. Thank you so much for your help.

 

Cheers,

 

Shimin 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    ShiminCai Helpful | Level 6
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?