Reputation: 1969
How can I get the download link of the uploaded file?
Lets say that I upload this file:
var file = api.UploadFile("dropbox", @"Public\Test.txt", @tmpFile);
where tmpFile is a local computer file. How do I get the download link of the file @"Public\Test.txt"
? It should be something like: https://dl.dropboxusercontent.com/u/81990845/Test.txt
Upvotes: 1
Views: 1130
Reputation: 16930
The kind of link that you included as a sample is from a Dropbox "Public" folder, but this feature isn't part of the API, and isn't available by default to new users, so you won't want to rely on this.
Instead, you should use the /shares call:
https://www.dropbox.com/developers/core/docs#shares
(This is implemented in all the official SDKs, and is usually available in third party libraries too.) This call returns a shareable link for this feature:
https://www.dropbox.com/help/167/en
By default, these links show a "preview" page where the user can share or download the file, but if you need a "direct" link (like those from the Public folder), you can modify these links as shown here:
https://www.dropbox.com/help/201/en
Upvotes: 1