READ NOW: Download Our Cloud Integration Strategy Guide to Learn How to Simplify Your Integrations

Kloudless Blog

Tutorials, case studies and how-tos from our experts

Monday Motivation: How to Download a Folder as a ZIP File in the Dropbox API

Photo by Samuel Zeller on Unsplash

“If we always helped one another, no one would need luck.”

Today marks the first in a long line of posts to come centered on helping you overcome some of the most commonly asked questions about the APIs we work with here at Kloudless. Every Monday, we will aim to help answer some of the oft-asked inquiries into the world’s most popular APIs. Today, we will be turning to one of the industry’s top names when it comes to file storage: Dropbox.

Boasting more than 500 million users, DropBox has been a bona fide giant of the cloud-based file storage world since its release in 2008. DropBox became the first of the ‘folder sync’ storage applications to become a household name, having been originally conceived when one of its co-founders left his USB flash drive at home and was stuck with no way to access his necessary files for a college class. As a result, DropBox has become ubiquitous with users looking to manage their files and documents in the cloud, and heavily utilized by applications looking to provide their users with storage integrations.

For a considerable amount of time, Dropbox’s API offered the ability to download folders stored in a user’s account as a ZIP file, as long as the folder did not exceed a certain size or contain too many files inside it. However, this functionality was not present in the Dropbox API v2 when it launched, and it’s removal prompted a considerable amount of users asking whether auto-zip functionality had been completely ditched in API v2.

Long story short, it had. At least, for a while.

Thankfully, Dropbox has added the capability back to their Dropbox API v2, so we wanted to take the time to walk you through how to go about offering this functionality to your application’s users.


The Dropbox docs provide all of the necessary information for adding this functionality to your codebase, but we’ll walk through the easy process below in a few short steps. First, keep in mind that there are a few limitations to the endpoint. The folder being requested must be less than 20 GB in size and have fewer than 10,000 total files. The input must be a folder, and cannot be a single file. Lastly, any single file contained in the folder must be less than 4GB in size.

The endpoint in question is the /download_zip endpoint. 

The only parameter necessary to provide this endpoint is a path param. This path parameter can contain the path to the folder or the associated id or rev of the folder itself.

A sample curl request to retrieve a ZIP file of the math folder would look like so, with your access token slotted in where it is missing below:

If the folder or files contained inside do not adhere to the rules laid out above, your response will be one of two different error codes. Too_large, if the folder is larger than 20 GB, or too_many_files if the folder contains more than 10,000 files inside of it.

That’s it! You can now provide your users with the native web application functionality that Dropbox itself provides: the ability to download entire folders as ZIP files.


When incorporating Dropbox functionality into your application, keep in mind the benefits of adding as many file storage providers as possible. If your users are ingrained in another file storage provider like Box, Egnyte, or Google Drive, they may forego your application entirely in search of a competitor that provides the connection to their preferred service. Give your users the choices they need, while bolstering your own application’s functionality, with the use of a Unified API from Kloudless. You can offer your users dozens of file storage services in the same amount of code it would take to connect to a single API. On top of that, when response formats change or APIs update their access endpoints, a Unified API handles all the future maintenance necessary to keep functionality working. To learn more about the Kloudless Unified Storage API, please download our free guide to storage integration strategy today!

Published By

David Hallinan

David Hallinan is Head of Content at Kloudless. He enjoys painting, JavaScript, vintage synths, drum machines and forcing his sports allegiances on his children.

View all posts by David Hallinan