Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get public url from file path in dropbox

Suppose I have dropbox account, and I have shared folder their, for instance the name of the shared folder is "SampleFolder". And inside that folder I have folder and file hierarchy, which also is shared being inside a shared folder. How can I having SampleFolder url and knowing the file path that I want to download easily get it's url either by Dropbox Core API or just know the way the urls are constructed and construct the url by hand. For instance I want to download file in path SampleFolder/Folder1/Folder2/image.png, how can I get the url of that file knowing only the url of SampleFolder? Let me note that I don't want to login into dropbox, here there is a get method for retrieving file by it's path, but it requires authorisation. Basically I want a public place of storing files, and in my code downloading them by their urls.

Thanks for the answers.

like image 591
kyurkchyan Avatar asked Jul 22 '13 13:07

kyurkchyan


4 Answers

[Addition Aug2017: This method has been disabled by Dropbox for all users. See https://www.dropbox.com/en/help/files-folders/public-folder]

See https://www.dropbox.com/help/16/en towards the bottom under "Creating a Public folder"

While newer accounts do not have the Public Folder enabled, it is possible to enable it by going to this link when logged into that account: https://www.dropbox.com/enable_public_folder

Then you can follow the path to the file after https://dl.dropbox.com/u/<user id>/

like image 78
Nathan Avatar answered Sep 28 '22 00:09

Nathan


This used to be possible with Dropbox, at least in the spring of 2012, but it appears no longer to work. Before, if you had a shared folder, you could browse the subcontents of that folder relative to the shared URL, but now, all the subcontents have distinct absolute URLs.

Breaking basic UNIX file path conventions like this is a huge loss in functionality, in my opinion.

like image 20
matt Avatar answered Sep 28 '22 00:09

matt


Set your link permission to anyone with a link. try the following link to access it as public static file:

https://dl.dropboxusercontent.com/s/<docId>/yourfile.ext

docId can be found by clicking on Share button of the doc on the dropbox UI. This the alphanumeric string found after /s/.

like image 38
karma Avatar answered Sep 28 '22 01:09

karma


Unfortunately, no, this isn't currently possible in an official or supported way. These shared links don't offer any metadata or API for access like this.

like image 29
Greg Avatar answered Sep 28 '22 00:09

Greg