Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester  here!

Forum Discussion

ShiminCai's avatar
ShiminCai
Helpful | Level 6
4 years ago
Solved

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.

3 Replies

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

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    4 years ago

    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's avatar
    ShiminCai
    Helpful | Level 6
    4 years ago

    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.6,037 PostsLatest Activity: 14 hours ago
412 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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!