I have a web app where user can upload a picture of his logo using dropbox api im able to save the file to a dropbox folder which is great
however i want to get the download link so using my angular client ill be able to set the img src tag and show the image
I've been using this implementation:
String url = client.sharing().createSharedLinkWithSettings("/" + clientId + "/logo." + fileName[1]).getUrl();
however as the name implies im getting a share link which is basically a web page with the image i only need the image is it possible?
This worked for me and was much easier than the solutions above, per this article:
To get a direct download link, replace the www.dropbox.com with dl.dropboxusercontent.com
EDIT: I've also discovered that you can add the query parameter ?dl=1
(dl meaning download and 1 meaning "enabled") to a shared link and that will make it a direct-download link as well. This is likely more reliable (long-term) than the method above.
Yes, use DbxUserFilesRequests.getTemporaryLink
instead. That will give you a temporary link that points directly to the file data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With