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

Forum Discussion

raziel79's avatar
raziel79
Helpful | Level 6
7 years ago
Solved

How to check if filezip is too big to download in shared link

Hi allo,

with JS api i have create a function that use 

sharingCreateSharedLink

for create a shared link and redirect user with ?dl=1 fro download it. But if zip is too big the user exit from my app and go on dropbox with 500 error. How to check id shared folder is too big to download and prevent redirect? is there any api ?

Best all 

  • so greg, this dropbox api offer very very basic functionalities but i found a way to do that:

    1. pass download path to my php sdk

    2. using listfolder api with recursive set to true

    3. reduce results entries with array_reduce php function to sum file size in bytes 

    4. check with dropbox filesize limit (20 gb + 10000 files count)

    5 and return status of check, if sum of files is to big or files count is greater than 10000 files

    i hope to be usefull for someone

    Best

4 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    Unfortunately, there isn't a way to check ahead of time if the folder is too big for the `?dl=1` mechanism. 

  • raziel79's avatar
    raziel79
    Helpful | Level 6
    7 years ago

    so greg, this dropbox api offer very very basic functionalities but i found a way to do that:

    1. pass download path to my php sdk

    2. using listfolder api with recursive set to true

    3. reduce results entries with array_reduce php function to sum file size in bytes 

    4. check with dropbox filesize limit (20 gb + 10000 files count)

    5 and return status of check, if sum of files is to big or files count is greater than 10000 files

    i hope to be usefull for someone

    Best

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    Thanks for following up with that. Yes, that would be the way to manually figure this out using the API. Apologies there isn't a more direct way of doing that!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,038 PostsLatest Activity: 3 hours ago
415 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!