You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
tim
9 years agoExplorer | Level 4
Download folder as ZIP in api v2?
One of my apps that i'm trying to migrate from API v1 to v2 uses the v1 functionality where you can download https://content.dropboxapi.com/1/files/auto/path/to/folder, and dropbox sends you a ZIP fi...
- 9 years ago
Hi Tim, API v2 doesn't offer zip folder downloads, but I'll pass this along as a feature request.
(Also, I'm not sure exactly what functionality you're referring to on v1, as there's no documented/supported zip folder download functionality on the /files endpoint you're referring to. Perhaps you're referring to the ability to download a zip from a shared link for a folder using the dl or raw URL parameters? That's unrelated to API version.)
Greg-DB
9 years agoDropbox Staff
Hi Tim, API v2 doesn't offer zip folder downloads, but I'll pass this along as a feature request.
(Also, I'm not sure exactly what functionality you're referring to on v1, as there's no documented/supported zip folder download functionality on the /files endpoint you're referring to. Perhaps you're referring to the ability to download a zip from a shared link for a folder using the dl or raw URL parameters? That's unrelated to API version.)
- Greg-DB7 years agoDropbox StaffThe Dropbox API v2 now offers the ability to download folders as zips:
https://www.dropbox.com/developers/documentation/http/documentation#files-download_zip
If you're using an official SDK, there will also be a corresponding method for this endpoint.- saifnirob7 years agoNew member | Level 2
I may have a question in the same category or case! I use the premium version of Dropbox with my another business account with Dropbox. I am developing a portal for my client where I want to give my client an option to download bigger files like 5GB. So, what you think is it possible with v2 api to let my client download 5gb files at a time using direct download?
If no, what is the maximum limit of download zip at a time or how much file size can handle v2 api to download at a time?- Greg-DB7 years agoDropbox Staff
saifnirob Using /2/files/download, there isn't any file size limit for downloading individual files. (It also supports Range retrieval requests.)
The /2/files/download_zip endpoint, for downloading entires folders as zips, however, does have some limitations. You can find information on those in the documentation.
- frphotos7 years agoExplorer | Level 4
Okay. I am sharing this code for people who needs to download dropbox folder as zip in C#. I can't find a solution in the web and I have to piece up my own code. Hope it helps.
private async Task Download(string foldername) {
string token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; var dbx = new DropboxClient(token); using (var response = await dbx.Files.DownloadZipAsync("/" + foldername)) { Stream ms = await response.GetContentAsStreamAsync(); Int16 bufferSize = 1024; byte[] buffer = new byte[bufferSize + 1]; Response.Clear(); Response.ContentType = "application/x-zip-compressed"; Response.AddHeader("content-disposition", "attachment; filename=myfolder.zip"); Response.BufferOutput = false; int count = ms.Read(buffer, 0, bufferSize); while (count > 0) { Response.OutputStream.Write(buffer, 0, count); count = ms.Read(buffer, 0, bufferSize); } } }
//To call it, place the download function in a page_load of a aspx (example: download.aspx)
//Link example: http://domainname/download.aspx?folder=abc123
//This link will directly download the folder as a zip file.
protected void Page_Load(object sender, EventArgs e)
{
string dropbox_folder = Request.QueryString["folder"];
if (dropbox_id == null)
Response.Redirect("http://google.com");
try
{
var DownloadTask = Task.Run(async () =>
{
await Download(dropbox_folder);
});
DownloadTask.Wait();
}
catch (Exception ex)
{
Response.Redirect("http://google.com");
}
} - cutch22226 years agoExplorer | Level 4
I am confused as to what the "version" is above this download_zip documentation (It says Version1 -- however it is on the Dropbox API v2 page.
- TaylorKrusen6 years agoDropbox Staff
Our apologies if the terminology is confusing.
We actually have two ways of versioning our API. One is the overall API version. The second (and the one you mention in your post) refers to the endpoint itself and has its own versioning.
In other words, you're using v2 of the overall API, but v1 of the download_zip endpoint.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 6 hours agoIf 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!