View Single Post
jonnenau's Avatar
Posts: 116 | Thanked: 445 times | Joined on Apr 2010 @ Oulu, Finland
#74
Originally Posted by Jaykie View Post
Jonne: While you're browsing Dropbox forums maybe you could also query about addition of public links to API At least for me it would be most likely the main use case:
1) Send a file to a Public folder in Dropbox via N900
2) Press e.g. "Copy Link" button to copy public link of the uploaded file to clipboard
3) Paste the link e.g. in IM chat for a friend to open

Of course I could get the link via web interface but if it could be done inside the native client, it would be superb
I was going to look at this later, but Oulu requests go on top of my morning (yes just woke up I coded until 6am in the morning) schedule I already had a hunch that I could generate the public links without dropbox API, note I can do this for the existing public folder as you said in your use case. The trick is that I get the followin account data when you authenticate from the API:

Code:
{ 
  'country': 'FI',
  'display_name': 'Jonne Nauha', 
  'email': 'jonne.nauha@evocativi.com', 
  'uid': 3589544, 
  'quota_info': 
  {
    'shared': 1299137987, 
    'quota': 2415919104L, 
    'normal': 232254872
  }
}
So useful information for the client to show to the user, like how much space you have left etc. I already use the display_name in the lower right corner so you know what you are logged in with. The uid field there is the important one.

All public links are with the following schema:
http://dl.dropbox.com/u/<uid>/path/to/file
Example for my uid:
http://dl.dropbox.com/u/3589544/Drop...-16-7-2010.png

So, I will put this in now and test my theory out UI wise, as this link is only for files not folders, when inside the /Public path and a file is selected I will hide the upload and new folder buttons as they are disabled anyway for files and replace the with 'copy public link' and 'open public link'. With the open button I'll pop the OS browser up, optionally I have my own browser with qt. But I assume the build in browser (or FF or Opera) can handle more file types than my custom one.

I think the API addition will be 1. setting a folder outside /Public to be shared 2. Generating the link from DP for that file, these links are valid for some months if I recall correctly.

Edit: /Public/* path items can now be opened directly with the OS default browser and copied to OS clipboard. Will be in the next release.

Last edited by jonnenau; 2010-07-28 at 14:31.
 

The Following 3 Users Say Thank You to jonnenau For This Useful Post: