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.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

download_zip

download_zip

Андрей Г.2
Explorer | Level 4

I have code that creates a zip archive folder from dropbox on the server https://monosnap.com/file/PtMN0G6kepdzGaKa0CfOtj7htL4YUa
please tell me if I can immediately download this archive to the user's browser without storing it on the server?

5 Replies 5

Greg-DB
Dropbox Staff

Your link is returning "404 Not Found", so I may not have full context here, but if you're making the Dropbox API calls on your server, you should be able to then return the information from the Dropbox API call down to the end-user of your site in their browser. Exactly how you do so will depend on your particular setup though, such your web framework, platform, and language. That's not specific to Dropbox though, so I can't provide exact instructions. I recommend referring to the documentation for your web framework, etc., for information on how to pass data back down to the user's browser.

Greg-DB
Dropbox Staff

That link is also not working, but in any case, I imagine you're referring to using the /2/files/download_zip endpoint. That returns the zip data for the requested folder in the request body directly. If you want to then return that data directly to the browser accessing your server, you should refer to the documentation for your web framework, etc., for information on how to do so.

Greg-DB
Dropbox Staff

That link is working. The endpoint URL is cut off, but it looks like you are referring to using /2/files/download_zip, and you're using curl to call it. I see you're setting 'CURLOPT_FILE' to send the result to a local file. You may want to use different curl options to put the result in memory instead of the local filesystem, and then pass that down to the browser using whatever web framework mechanism is available to you.

 

The curl library and whatever web framework you're using, if any, aren't made by Dropbox though so we can't provide support for those. I recommend referring to the documentation for those for information on configuring them.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Андрей Г.2 Explorer | Level 4
What do Dropbox user levels mean?