One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
SahithKumar
6 years agoExplorer | Level 4
How to get file link address from a sharable link programmatically
Hii. I am working on a web app using django. I was able to create a sharable link to a file but stuck at getting only the file address. My purpose is to add the url to an img tag in html. So in order to achieve that i need the image link address. So how can i get it. Thank you.
SahithKumar If you just need a temporary link to the file data, you should use /2/files/get_temporary_link. That will give you a direct link to the file data that lasts for four hours.
If you need a longer-lived link though, you should use /2/sharing/create_shared_link_with_settings. As you found, by default, that will give you a link to an HTML preview page of the file, not the file data itself. You can modify the link to point to the file data though, using the "raw" URL parameter documented in this help article.
- SahithKumarExplorer | Level 4
no this does not work.
Let me be some more clear.
First i am creating a sharable link to an uploaded file but this link wont provide me the content i need. For example if i uploaded an image and created a sharable link and if i try to add this link to img tag in html the image wont get loaded. In order to load an image i need the image's link address or the src link of that image only then i can access it. How i can achieve this.
Thank you.
- Greg-DB
Dropbox Staff
SahithKumar If you just need a temporary link to the file data, you should use /2/files/get_temporary_link. That will give you a direct link to the file data that lasts for four hours.
If you need a longer-lived link though, you should use /2/sharing/create_shared_link_with_settings. As you found, by default, that will give you a link to an HTML preview page of the file, not the file data itself. You can modify the link to point to the file data though, using the "raw" URL parameter documented in this help article.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 14 hours 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!