cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We want your feedback when it comes to using Dropbox in a web browser. Tell us your thoughts right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1
Ask
2
Reply and help

c# Files.DownloadZipAsync, how do I get link from this Api call?

c# Files.DownloadZipAsync, how do I get link from this Api call?

frphotos
Explorer | Level 4

When I call this API endpoint "Api.Files.DownloadZipAsync", why am I not getting any link to the zip file?

Instead I am getting name, path_lower, path_display, id.

 

When I run it on the API explorer, it formed a link in the button below ... something like "blob:https://dropbox.github.io/e05a95ca-8ff7-473b-93ec-b339db391dde"

 

How do I form this download link?

 

Am I doing something wrong?

 

Below is my code snippet

using (var dbx = new DropboxClient(token))
{
     zipdownload = await dbx.Files.DownloadZipAsync("/fr_test");
}
3 Replies 3

Re: c# Files.DownloadZipAsync, how do I get link from this Api call?

Greg-DB
Dropboxer

The DownloadZipAsync method will return the zip data directly to your app. It does not itself return a link to the data. You can have your app do whatever you want with it (e.g., serve it back to the user, save it locally, etc.). You can find an example of accessing the data here:

 

https://github.com/dropbox/dropbox-sdk-dotnet/blob/23b85606c92fc05fc1e6a2da4c6d10662b0c8683/dropbox-...

 

(That's an example of using DownloadAsync, but accessing the data works the same way for DownloadZipAsync.)

 

The API v2 Explorer, for instance, takes the returned zip data, and makes it available to the user via a blob URL directly in the browser. This isn't part of the API itself, but rather just something implemented in the API v2 Explorer itself as a convenience to developers using it to test the API.

Re: c# Files.DownloadZipAsync, how do I get link from this Api call?

frphotos
Explorer | Level 4

A quick question, I am using this Files.DownloadZipAsync inside a web application.
Once I obtain the data from "await response.GetContentAsStringAsync();"
How do I convert the stream data to be a physical url link like how the API v2 Explorer did via a blob URL?

 

Any leads to an example or method resources would be great.

Re: c# Files.DownloadZipAsync, how do I get link from this Api call?

Greg-DB
Dropboxer
The ability to create a blob URL is something native to browsers. You're writing in C#/.NET, outside of a browser, so this will work very differently.

Exactly how you do something like that will also depend on your scenario. For example, since you're building a web app, you can use your web framework to make the data available at some URL. That's outside of what I can help with as Dropbox API support, so I recommend referring to the documentation for the web framework that you're using.
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    frphotos Explorer | Level 4
What do Dropbox user levels mean?
Need more support?