-1

Using the dropbox SDK for a client side angular project. I'm able to call filesDownloadZip() but I'm not able to do anything with the result.

I'd like the browser to download the file with it's default behavior but I can't figure out how to "force" the browser to download the file.

Any ideas?

http://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesDownloadZip__anchor

Here's the function call as it exists right now. I'm not really sure what I need to do in order to force a download.

  filesDownloadZip(path){
    return dropboxSDK.filesDownloadZip({path:path}).then(x=>{
      console.log(x);
      console.log('downloaded')
    })
  }
Justin Young
  • 2,393
  • 3
  • 36
  • 62

1 Answers1

0

[Cross-linking for reference: https://www.dropboxforum.com/t5/API-Support-Feedback/Download-Entire-Folder-as-ZIP/m-p/322776/highlight/true#M18971 ]

There's an example of handling download-style requests using the Dropbox API v2 JavaScript SDK here:

https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/download/index.html#L52

(Getting the data from the sharingGetSharedLinkFile method works the same way as from the filesDownloadZip method.)

In short, you can get the data from the fileBlob property of the result, and then do whatever you wish with it, such as building a download button, as shown in the example.

Greg
  • 16,359
  • 2
  • 34
  • 44