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
MarekKonderla
4 years agoNew member | Level 2
Ziping 1GB folder and downloading it as client
Hi, I have been experimenting with dropbox api on my PHP project and everything is working fine, until I try download bigger folders (cca 1GB). The downloadZip method from SDK is returning a huge bod...
MarekKonderla
4 years agoNew member | Level 2
So I have found a solution.
Example:
header("Content-Type: application/zip"); header("Content-Transfer-Encoding: Binary"); header("Content-Disposition:attachment;filename=" . $album->name . '.zip'); $opts = [ 'http' => [ 'method' => "POST", 'header' => "Authorization: Bearer TOKEN\r\n" . "Dropbox-API-Arg: ".json_encode([ "path" => $path ])."\r\n", 'body' => '' ] ]; $context = stream_context_create($opts); $fp = fopen('https://content.dropboxapi.com/2/files/download_zip', 'r', false, $context); fpassthru($fp); exit();
Which essentialy streams output of dropbox endpoint directly to a client, without a need to store it to memory.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 11 days ago
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!