Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
nive
3 years agoExplorer | Level 4
Downloading a zip file using Api doesnt work
Hello Team ,
I have a "App folder" created and I try to list all the files inside the folder . From the response received , I grep for a particular zip file and download the zip file using "/2/...
Greg-DB
Dropbox Community Moderator
3 years agoThe /2/files/download_zip endpoint is only meant for downloading folders from Dropbox, not files. (Dropbox zips the folder into a zip file on the fly for that.) To download a file (whether the file is a .zip file or not), you would use the /2/files/download endpoint instead.
Also, it looks like your `path` value might be malformed regardless, at least based on the code you shared here, since you're building it as `"/$dropboxFolderPath/$latestFilename"`, and you're setting `dropboxFolderPath` as `dropboxFolderPath=""`, so `"/$dropboxFolderPath/$latestFilename"`, would contain an empty path component as the first path component.
In any case, you should also check the status code of the HTTPS response to see if the call succeeded or failed, and only save the data if the call succeeded. If it failed, you might just be saving the error message instead of the file data.
And for debugging issues, you can use the "-v" flag on curl to enable verbose output.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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, Facebook or Instagram.
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!