cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

@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

Hongyi S.
Explorer | Level 4
Go to solution

SahithKumar
Explorer | Level 4
Go to solution

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
Go to solution

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

Need more support?
Who's talking

Top contributors to this post

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