Dropbox 共享文件 URL
我正在开发一个 Android 应用程序,它使用 Dropbox 来组织文件。我正在探索 Dropbox API,但它的描述和帮助很有限,因为没有 Dropbox API 的文档。
我仍然想通过某些功能来管理文件,例如放置文件和从 Dropbox 获取文件。现在的问题是,当我将一些文件放入 Dropbox public 文件夹中时,我需要一个 URL 来与应用程序中的联系人共享。但在 API 中我找不到任何返回要共享的文件的 Web URL 的函数(就像在 Dropbox 的桌面界面中一样,用户可以获得共享 URL 发送给朋友)。
有人可以帮我弄清楚如何与应用程序中的联系人共享该文件吗?
或者使用 Dropbox Android API 共享文件的任何其他方式?
I am developing an application for Android and which uses Dropbox for organizing the files. I am exploring the Dropbox API but its description and help is limited, as there is no documentation for the Dropbox API.
I still would like to manage the files to some functionality, for example placing a file and getting a file from Dropbox. Now the problem is when I put some files in Dropbox public folder and I need a URL to share to my contacts in the application. But in the API I could not find any function that returns the web URL of the file to share (Just like in the Deskotop interface of Dropbox, a user can get a Shared URL to send to friends).
Could someone help me figure out how to share that file with contacts in the Application?
Or any other way to share a file using Dropbox Android API?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据此处提到的 DropBox 所做的更改: https://www.dropbox.com/help/16/ zh
将不再有公共文件夹,而是可以通过共享链接访问文件。
如果您使用 Android DropBox Core Api,则可以通过以下方式检索共享链接:
更新:2014/07/20 by Dheeraj Bhaskar
将以下辅助函数与上述函数一起使用。
由于 DropBox 开始发送缩短的链接,因此获取正确的链接会遇到一些问题。
目前,我正在使用此方法:
我们只需加载 URL,遵循重定向并获取新 URL。
2014/07/25 更新:Dropbox 共享 URL 的更改
关于预期 URL 类型的提示
来自 Dropbox 团队:
According to changes made on DropBox metioned here: https://www.dropbox.com/help/16/en
There would be no more Public folders, instead access to files can be done via Share Link.
If you use Android DropBox Core Api then shared link can be retrieved this way:
UPDATE: 2014/07/20 by Dheeraj Bhaskar
Use the following helper function alongwith the above function.
Since DropBox started to send shortened links it is little bit more problematic to get proper link.
For now, I am using this method :
We simply load the URL, follow the redirects and get the new URL.
Update 2014/07/25: Change in dropbox share URLs
A heads-up on the kind of URLs to expect
From the Dropbox team:
Dropbox 论坛中的一个有用帖子:
http://forums .dropbox.com/topic.php?id=37700&replies=7#post-326432
如果文件的公共链接始终存在
,那么我们可以只需使用 API 来获取并在代码中构建公共 URL 即可。
也许这也可能有帮助:将文件上传到 Dropbox 并复制公共地址。此脚本将文件上传到您的 /Public 目录并使用您的帐户
用于构建其公共 URL 的 UID。然后,它将 URL 回显到控制台。
https://github.com/sylvainfilteau/dropbox-api-command/commit/6aa817c79220c5de4ff5339cd01ea8b528bcac36
我还没有实现 Dropbox 界面,但这是我需要的功能之一发展。我希望一两天内会有更多。
A useful thread in the Dropbox forums:
http://forums.dropbox.com/topic.php?id=37700&replies=7#post-326432
IF The public link for a file is always
then we can just use the API to get and build the public URL in the code.
Perhaps this may also help: Upload a file to Dropbox and copy public address. This script upload a file to your /Public directory and use your accound
UID to build it's public URL. Then, it echoes the URL to the console.
https://github.com/sylvainfilteau/dropbox-api-command/commit/6aa817c79220c5de4ff5339cd01ea8b528bcac36
I am not there yet in my Dropbox interface implementation, but this is one of the functions I need to develop. More in one or two days I hope.
我相信网址如下:
http://dl.dropbox.com/u/YOUR_DROPBOX_ID/YOUR_FILE_NAME
I believe the url is as follows:
http://dl.dropbox.com/u/YOUR_DROPBOX_ID/YOUR_FILE_NAME