cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close

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: 
Highlighted

How to get file link address from a sharable link programmatically

Explorer | Level 4

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.

1 Accepted Solution

Accepted Solutions
Highlighted

Re: How to get file link address from a sharable link programmatically

Dropboxer
Dropboxer

@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.

View solution in original post

3 Replies 3
Highlighted

Re: How to get file link address from a sharable link programmatically

Explorer | Level 4
Highlighted

Re: How to get file link address from a sharable link programmatically

Explorer | 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.

Highlighted

Re: How to get file link address from a sharable link programmatically

Dropboxer
Dropboxer

@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.

View solution in original post

Polls
Do you know how to organize your files and folders?
We have created a guide on folder best practice, so you can get organized now check it out here.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?