cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

How to get file link address from a sharable link programmatically

How to get file link address from a sharable link programmatically

SahithKumar
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

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

Greg-DB
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

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

Hongyi S.
Explorer | Level 4

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

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

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

Greg-DB
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

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

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