Dropbox上传后获取文件的公共URL [英] Dropbox get public url of the file after upload
问题描述
需要将文件上传到保管箱并获取该文件的公共URL。我正在生成缩略图,需要在我的网站上显示。我还应该向用户显示原始文件,而无需登录到保管箱站点。
Need to upload files to dropbox and get the public url of that file. I'am generating thumbnails and need to show that in my site. I should also show the original files to users without login to the dropbox site.
上传到保管箱后,我需要获取原始文件的url,供crocodoc api查看器使用。
After uploading to dropbox I need to get the original file url which will be used by crocodoc api viewer.
我可以上传文件,并且正在获取文件的元数据。我创建了共享的url,并给出了html中的url img标签的url,但似乎返回的是html而不是图像。
I could able to upload the file and I am getting the metadata of that file. I created shared url and given that url that url img tag in html but seems returning as html instead of image.
我经历过SO中提到的类似问题,但几乎所有人都在参考旧文档。
I have gone through similar questions mentioned in SO but almost all are referring old documents.
推荐答案
我早些时候发现了这个窍门,以为我愿意分享。
I found this trick earlier and thought I'd share.
转到: https://www.dropbox.com/home
然后,将鼠标悬停在某个项目上,单击共享。
这将弹出:
Then, highlight your mouse over an item, click on share. This will popup:
只需更改:
https://www.dropbox.com/s/io9oz94lgm2j2bb/loadingscreen.jpg?dl=0
到
https://dl.dropbox.com/s/io9oz94lgm2j2bb/loadingscreen.jpg
将 www
替换为 dl
,以获得直接的公共 url。
Replacing the www
with dl
, to get the direct, public url.
这篇关于Dropbox上传后获取文件的公共URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!