Image not being retrieved from Dropbox

偶尔善良 提交于 2019-12-05 10:49:44

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.

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!