Link to home
Start Free TrialLog in
Avatar of xenium
xenium

asked on

How to get a dropbox url from the windows path

Hi,

If i right-click on a dropbox file in Windows I have the option to "Share dropbox link". this will give me a public URL (and presumably sets the file up for sharing)

I would like to get this link automatically for a bunch of files. If there any way to do this? I'm ok to use Excel VBA or a bat file, but aside from that I'd be reluctant to code something else up.

Any pointers welcome.

Many thanks
Avatar of NVIT
NVIT
Flag of United States of America image

I'd start by searching the registry for the text: Share dropbox link
When found, browse the subkeys for the related command value
Avatar of xenium
xenium

ASKER

Thanks, any tips how to do this from a dos prompt?

Also, if the link is only created by invoking the menu option "share dropbox link" how else could this work?

Thanks
Many times, a right-click on a file means the option may be in the registry. To search the registry...

1. Press Ctrl-R. A Run dialog appears.
2. Type regedit.
3. Press Ctrl-F
4. Type Share dropbox link.
5. Press F3 to find next result. Continue F3 till you find it, or no more results
6. If that doesn't bring results. Find DROPBOX  instead.
Avatar of xenium

ASKER

Thanks for that.

Nothing for Share dropbox link. Various results for dropbox mainly DropboxExt, nothing that makes any sense to me though, no recognizable URLs so far (but maybe i need to press F3 another 50 times)

I'll update if any change, but meanwhile any further ideas welcome.
Avatar of xenium

ASKER

I've just tried to search the registry for a known dropbox URL in case that brings anything up, but no luck.
If you post the link we may be able to help--I assume it has some common URL address and then the tail end related somehow to the file--if I know that and how it relates to the windows file name then we can do a dir if the folder and gather those names and auto add them to the tail end of the url--make sense?
Avatar of xenium

ASKER

Ok here goes a test file shared:

Public URL: https://www.dropbox.com/s/ufk9q59ezybq0qk/Q_28662636_file1.jpg?dl=0
Public URL

Windows path:  C:\Users\user\Dropbox\share\ee\Q_28662636_file1.jpg

Some test results that should be useful:

a) the dropbox key (in the URL) seems to be a fixed function of the filename and path
b) if the file is renamed or moved (in Windows), the public URL will no longer work
c) if the file is deleted and replaced by a new file with the same name, the existing public URL will continue to work
Avatar of xenium

ASKER

In case it helps, here is a link to a shared folder on my Dropbox.. welcome to do any tests here:

public URL: https://www.dropbox.com/sh/gq0naetm52rxbx5/AABz5vPQiW51wAagTsvYBb9Ja?dl=0
windows path: C:\Users\user\Dropbox\share\ee\Public\
OK so are you looking for a solution that will follow the file, change if it is moved, or renamed or deleted and know if it is replaced with a different file? If so then what I was thinking of would not work. I was think of replacing the windows name discovered from doing a DIR in the URL that contains the name, namely /Q_28662636_file1.jpg
Avatar of xenium

ASKER

I don't need any such tracking for now. A simple solution to generate the URL from the file path would be great.

I just mentioned these tests in case the info is helpful.  Maybe the relationship could be reverse engineered from a few examples.
So if you have a list like this
C:\Users\user\Dropbox\share\ee\test1.doc
C:\Users\user\Dropbox\share\ee\test2.doc
C:\Users\user\Dropbox\share\ee\test3.doc
Do you want to end up with a list o URL's like this?
https://www.dropbox.com/s/ufk9q59ezybq0qk/test1.doc?dl=0Public URL
https://www.dropbox.com/s/ufk9q59ezybq0qk/test2.doc?dl=0Public URL
https://www.dropbox.com/s/ufk9q59ezybq0qk/test3.doc?dl=0Public URL
Maybe this?
@echo off
set LocDir=C:\Users\user\Dropbox\share\ee
set WebHead=https://www.dropbox.com/s/ufk9q59ezybq0qk/
set WebTail=?dl=0Public URL
set FNResults=%temp%\DropBoxList.txt

for %%a in (%LocDir%\*.*) do echo %WebHead%%%~na%%~xa%WebTail%>>"%FNResults%"
start notepad "%FNResults%"

Open in new window

Avatar of xenium

ASKER

lionelmm: yes, but with the correct keys.

NewVillageIT (NVIT):  the key which you've hardcoded is a variable.

Dropbox is generating a unique key for each file, in my example it's ufk9q59ezybq0qk, but this won't work for any other file.
Avatar of xenium

ASKER

.. oh i wish it were that easy...!
if each file has a unique ID like ufk9q59ezybq0qk then I can't think of any possible way to do this unless you can store a local copy with the unique identifiers to be able to parse through that list. I don't know dropbox well enough to see you can get a list of all the files with their unique identifiers or not.
Avatar of xenium

ASKER

I can't see any way either, which is why I'm posting here, but the conversation is helping me learn a little more.

As I mentioned, the URL seems to be generated 1:1 from the Windows path, ie it does not seem to be related to any other variables. e.g. if I delete the file in Windows, and put a different file in place with the same filename, then invoke the "Share dropbox URL" then the same key is given. I guess the key is generated using an algorithm with the file path as input.

If this is the case then could there be some clever algorithm out there which can reverse engineer it from some strategically created examples? If so should I post this under another section? Any suggestions welcome.

Thanks again.
What exactly are you trying to (other than to get this list); what do you need it for, how do you want to use? Maybe there is some other way other than getting a list to solve the main problem you are trying to solve.
Avatar of xenium

ASKER

Ok some background:

I'm using dropbox to track a repair process. New items (mostly jpg photos) are dropped into the dropbox, and moved into subfolders depending on their status (open, closed, etc)

On my PC i can see a list of the items with thumbnails, and sort/filter etc using windows as normal which is useful, but i cannot print or export this list (maybe there's an alternative here..)

My idea is to create a bat file which generates a printable listing in html format. I could do this now from the windows path info, but ideally I would like to be able to view the same list from online (ie when not on my pc), in which case i would need the public URLs.

Thanks for your inputs.
OK I contacted dropbiox for you--they said this is not something that can natively be done; said you would have to get an external app but they could not tell me specifically one that could do it. They did give me this link but I did not find anything there that may help you but maybe you will https://www.dropbox.com/business/resources/app-integrations#productivity
Avatar of xenium

ASKER

Thanks. I will try to contact them to obtain the algorithm and post here if I get it.
ASKER CERTIFIED SOLUTION
Avatar of xenium
xenium

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That looks like you are going to need to do some serious scripting to be able to get what you wanted especially since they say the links are generated on demand
Avatar of xenium

ASKER

yeah looks pretty heavy. what platform would be the easiest to implement coming from scratch?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Now that you know what is required you should create a new question and list it under the scripting section. I also can't imagine you are the only one who needs something like this so you may want to check the dropbox forums too.
Avatar of xenium

ASKER

Thanks all for your input so far.

I probably need to re-post to get new input, but the question remains unaltered and unanswered.
I agree we have not provided a ultimate solution yet but you wanted to know "I would like to get this link automatically for a bunch of files. If there any way to do this?" and we have at least determined it is technically possible, the question is now how to do so. You could request attention on your question and ask them to move it to the coding/scripting section or create another. Ultimately it is up to you to decide if the info and help we have given you thus far has been worthwhile or not.
Avatar of xenium

ASKER

Well spotted, I stand corrected! I only asked if it's possible, so technically the question is answered... yes it is possible :-)

I think I'll go with posting a new question, and settle the score here so far.

Thanks again.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xenium

ASKER

dropbox tech support