cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

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

How can I get public URLs for all files within a folder?

How can I get public URLs for all files within a folder?

Vincent P.9
Explorer | Level 4

Hi,

 

I use Dropbox to manage a photo gallery. Co-workers can change photos within the folder and I can show them on our website.

 

Right now, I proxy the request to get the file but that's a lot of calls and files are heavy.

 

Instead, I would like to embed to use the Dropbox URL directly to show photos, like:

<img src="https://www.dropbox.com/s/fn64tdfaregvefez/001.jpg" />

 

Is there a way to get public URLs for all files within a folder?

 

Thanks

5 Replies 5

Greg-DB
Dropbox Staff
If you want to get the shared links like the one in your sample, you can use /2/sharing/create_shared_link_with_settings to create one, if one doesn't already exist:

https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_...

If you're using an official SDK, there will be a corresponding method for that.

Note that you'll need to call for each file in the folder that you want.

A link already exists, you can use /2/sharing/list_shared_links to retrieve it:

https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_shared_links

Also, note that by default, these shared links point to preview pages, not the files themselves, but you can modify them for direct access as shown here:

https://www.dropbox.com/help/desktop-web/force-download

Vincent P.9
Explorer | Level 4

Hi,

 

Thank you for your answer. I was trying it and it's extremely slow to create new links with create_shared_link_with_settings, is there a way to batch that?

 

Thanks!

Greg-DB
Dropbox Staff
No, unfortunately there isn't a way to create shared links in bulk, but I'll pass this along as a feature request.

hypebaestyle
New member | Level 2

And what about now? Did you already do it? We need to upload many photos from dropbox to our website, and if we will do it one by one - it will be very, very long process! Is there any solution to automate share links creation from folder with image files?

Greg-DB
Dropbox Staff

@hypebaestyle No, unfortunately the Dropbox API still doesn't offer a batch shared link creation endpoint.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    hypebaestyle New member | Level 2
  • User avatar
    Vincent P.9 Explorer | Level 4
What do Dropbox user levels mean?