Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image not being retrieved from Dropbox

Hi! I have an image slider. When I try toe retrieve the images from my server, the images are properly displayed. (http://stthomasmountmtc.org/index.html)

However, when I try to retrieve the same images from Dropbox, the images are not displayed/retrieved. (http://stthomasmountmtc.org/index1.html)

 <img src="https://www.dropbox.com/s/woart55urbw792u/image1.jpg" alt="image" />

When I open the link in the src attribute in the browser, the images can be seen, so the link is obviously not broken. Please share your suggestions.

Thanks, Samuel Mathews.

like image 839
Samuel Mathews Avatar asked May 01 '14 13:05

Samuel Mathews


People also ask

Does Dropbox have image search?

Image search is only available to Dropbox Professional and Dropbox Business users. You can search images in your Dropbox account based on the content in them. For example, you can search for “cat” to see all images of cats (and images related to cats) in your Dropbox account—even if “cat” isn't in the filename.


3 Answers

The link in your code opens the gallery feature of Dropbox, which is a HTML webpage, not an image file. The direct link for that image is:

https://dl.dropboxusercontent.com/s/woart55urbw792u/image1.jpg

You should always set the source of an image tag in HTML to an URL which outputs an image - and not a webpage containing an image.

like image 75
mcserep Avatar answered Oct 19 '22 14:10

mcserep


Another option to view a Dropbox image directly is to access the Dropbox link using the ?raw=1 parameter.

For example, if the Dropbox link is:

https://www.dropbox.com/s/83dcx4efx791s2i/stackoverflow.png?dl=0

change the ?dl=0 to ?raw=1, such as:

https://www.dropbox.com/s/83dcx4efx791s2i/stackoverflow.png?raw=1

Note that using "?dl=1" (instead of dl=0) will download the image.

Reference: https://www.dropbox.com/help/201

like image 31
kwriter Avatar answered Oct 19 '22 16:10

kwriter


I was able to get this to work while trying to address a similar problem by logging into Dropbox, viewing the image itself, right clicking on the image and selecting "Copy Image Address".

like image 1
pacManKana Avatar answered Oct 19 '22 15:10

pacManKana