We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

ShiminCai's avatar
ShiminCai
Helpful | Level 6
3 years ago

File Upload Limit

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:

 

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

 

 

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

  • Здравко's avatar
    Здравко
    Legendary | Level 20

    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.

      • ShiminCai's avatar
        ShiminCai
        Helpful | Level 6

        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 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,878 PostsLatest Activity: 4 hours ago
326 Following

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!