cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

View, download, and export

Need support with viewing, downloading, and exporting files and folders from your Dropbox account? Find help from the Dropbox Community.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting downloading link of files in Dropbox automatically

Getting downloading link of files in Dropbox automatically

136446
Explorer | Level 3
Go to solution

I have some huge images in a folder on the web version of Dropbox that I need to make a shell script to download them one by one (There isn't enough room on my SDD and can't download the whole folder). I know using "wget" I can download a file:

wget link_to_the_file

However since I have many images it is not feasible to get the download link of each of them manually. I'm looking for a way of obtaining downloading link for each of them through the shell. Any suggestions?

1 Accepted Solution

Accepted Solutions

Jay
Dropbox Staff
Go to solution
There isn’t a way to download each image sequentially while logged into your account, or to generate links for each one in bulk.
 
However, there is a small workaround using shared links and forcing files to render on the site.
 
If you share a link to the entire folder, each image should be visible there. Now, since you can’t download the entire folder in bulk due to space constraints, you can make a script to download the images in turn, by slightly modifying the link. 
 
Here’s an example of what I mean. If your shared folder links to the following location:
 
 
Then an image in that folder would have the URL as:
 
 
Note that the first portion of that folder, https://www.dropbox.com/sh/xiuioh21409nsj5j/, is the same, whereas the rest are different since each image has it’s own link.
 
To automatically download the image, using the Dropbox site itself, just change the dl=0 to dl=1.
 
However, wget needs the original file, not a URL redirect to a download. Dropbox can render images by changing the ending to raw=1. So your script would look like:
 
wget https://www.dropbox.com/sh/xiuioh21409nsj5j/AAkanlaoidsgmq90mdg/DCIM0001.png?raw=1
 
This would download the DCIM0001.png image directly.
 
If your script can scrape the URLs from the shared link page, then change the last part of the URL to suit your needs, and enter it into a terminal/command prompt or batch file, then you can do it.
 
Admittedly, this isn’t the easiest of things to do, and this will contribute to the daily bandwidth allowance for your account, however, this might help with your unique situation.

Jay
Community Moderator @ Dropbox
dropbox.com/support


Heart Did this post help you? If so, give it a Like below to let us know.
:arrows_counterclockwise: Need help with something else? Ask me a question!
:pushpin: Find Tips & Tricks Discover more ways to use Dropbox here!
:arrows_counterclockwise: Interested in Community Groups? Click here to join!

View solution in original post

4 Replies 4

Rich
Super User II
Go to solution

wrote:

I'm looking for a way of obtaining downloading link for each of them through the shell. Any suggestions?


There is no such function available within the Dropbox app or website. Share links can only be created manually, one at a time.

 

If you have any programming skills you may be able to use the Dropbox API to generate the links en masse.

Jay
Dropbox Staff
Go to solution
There isn’t a way to download each image sequentially while logged into your account, or to generate links for each one in bulk.
 
However, there is a small workaround using shared links and forcing files to render on the site.
 
If you share a link to the entire folder, each image should be visible there. Now, since you can’t download the entire folder in bulk due to space constraints, you can make a script to download the images in turn, by slightly modifying the link. 
 
Here’s an example of what I mean. If your shared folder links to the following location:
 
 
Then an image in that folder would have the URL as:
 
 
Note that the first portion of that folder, https://www.dropbox.com/sh/xiuioh21409nsj5j/, is the same, whereas the rest are different since each image has it’s own link.
 
To automatically download the image, using the Dropbox site itself, just change the dl=0 to dl=1.
 
However, wget needs the original file, not a URL redirect to a download. Dropbox can render images by changing the ending to raw=1. So your script would look like:
 
wget https://www.dropbox.com/sh/xiuioh21409nsj5j/AAkanlaoidsgmq90mdg/DCIM0001.png?raw=1
 
This would download the DCIM0001.png image directly.
 
If your script can scrape the URLs from the shared link page, then change the last part of the URL to suit your needs, and enter it into a terminal/command prompt or batch file, then you can do it.
 
Admittedly, this isn’t the easiest of things to do, and this will contribute to the daily bandwidth allowance for your account, however, this might help with your unique situation.

Jay
Community Moderator @ Dropbox
dropbox.com/support


Heart Did this post help you? If so, give it a Like below to let us know.
:arrows_counterclockwise: Need help with something else? Ask me a question!
:pushpin: Find Tips & Tricks Discover more ways to use Dropbox here!
:arrows_counterclockwise: Interested in Community Groups? Click here to join!

136446
Explorer | Level 3
Go to solution

Thanks. It is strange that

dropbox doesn't have any solution for this! Your workaround is quite good, there is only one issue: as you mentioned in thelink for each image there is a unique (seems to be unique) string. So if you wanna make a script to download the images without manually copying its link, how do you get the full link of that image including the unique part?

Jay
Dropbox Staff
Go to solution
Well, I haven’t tested it here due to our restrictions, but there are some browser extensions that can download all the links and images on any webpage you’re viewing. 
 
I’m sure there’s a way for those plugins to filter by URL, and then export that list to a file to which you can run your own script to rename dl=0 to raw=1, and append wget at the beginning of the URL. 
 
Wish I could give better info but as this is a very custom-made workaround, it depends on how you approach it yourself!
 
[This thread is now closed. If you have a similar or new question, you can ask here]

Jay
Community Moderator @ Dropbox
dropbox.com/support


Heart Did this post help you? If so, give it a Like below to let us know.
:arrows_counterclockwise: Need help with something else? Ask me a question!
:pushpin: Find Tips & Tricks Discover more ways to use Dropbox here!
:arrows_counterclockwise: Interested in Community Groups? Click here to join!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Jay Dropbox Staff
  • User avatar
    136446 Explorer | Level 3
  • User avatar
    Rich Super User II
What do Dropbox user levels mean?