# 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
###### Who is Participating?

Author Commented:
from dropbox:

"Thanks for writing in. There isn't an algorithm you can use locally to calculate these exactly, as these links are actually generated on demand on the server. There is an API endpoint you can use to retrieve these links though. Specifically, you'd want to use the /shares endpoint:

https://www.dropbox.com/developers/core/docs#shares

You'd need to have the user first authorize an API app you registered to access their account before you can do so though.

For reference, you can find everything you need to get started with the Dropbox API, including documentation, tutorials, and SDKs here:

https://www.dropbox.com/developers/core

Regards"
0

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

Author Commented:
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
0

Commented:
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
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.
0

Author Commented:
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.
0

Author Commented:
I've just tried to search the registry for a known dropbox URL in case that brings anything up, but no luck.
0

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?
0

Author Commented:
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
0

Author Commented:
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\
0

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
0

Author Commented:
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.
0

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
0

Commented:
Maybe this?
@echo off
set LocDir=C:\Users\user\Dropbox\share\ee
set WebTail=?dl=0Public URL
set FNResults=%temp%\DropBoxList.txt

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

0

Author Commented:
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.
0

Author Commented:
.. oh i wish it were that easy...!
0

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.
0

Author Commented:
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.
0

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.
0

Author Commented:
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.

0

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
0

Author Commented:
Thanks. I will try to contact them to obtain the algorithm and post here if I get it.
0

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
0

Author Commented:
yeah looks pretty heavy. what platform would be the easiest to implement coming from scratch?
0

Commented:
I think this won't help because the url changes. Would it?
http://superuser.com/questions/837307/how-to-get-the-url-of-dropbox-file-from-command-line

> what platform would be the easiest to implement
I'd go with python.
0

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.
0

Author Commented:
Thanks all for your input so far.

I probably need to re-post to get new input, but the question remains unaltered and unanswered.
0

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.
0

Author Commented:
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.
0

That's not what I meant to convey, that the question is "technically" answered, but to say that "at least" I have shown you where you can find more information and that what you want to do has a potential solution but one that will require a specific solution or some investigating into finding someone else who found a solution to similar problem. I'm sure someone in the dropbox community has a similar need and may ahve already found it. Further the technical details that dropbox sent indicate that the variables you need are available by coding.
0

Author Commented:
dropbox tech support
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.