You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

hb-dev's avatar
hb-dev
Explorer | Level 4
3 years ago

PHP: get direct link to every file in a folder

Hi,
So we are handling DICOM images to be shown in a web viewer.
The problem now is that there are 3000+ files  that need to be loaded in the viewer.
The JS viewer takes direct links for files as array to load and display them.
Is there a way to get list of files with direct links using https://api.dropboxapi.com/2/files/list_folder 

 

  • Здравко's avatar
    Здравко
    Legendary | Level 20

    Hi hb-dev,

    2/files/list_folder lists a folder content (as the name suggests) and returns files and folders residing within directly or recursively (depending on "recursive" parameter). Most probably you will need 2/files/list_folder/continue to complete the list retrieval.

    To receive links to the files inside, you can use 2/files/get_temporary_link for temporary link on every single file of interest (i.e. DICOM image) or call 2/sharing/list_shared_links to list in one call all available shared links (or in fewer calls at  least). In case of list shared links, the links should exists in advance and created using 2/sharing/create_shared_link_with_settings (at addition moment for example). Links created in such a way are permanent (if not set something else explicitly) and listed links are preview links, not raw! Most probably your viewer needs raw links and you have to replace ending "?dl=0" to "?raw=1" for every single link before adding it to the viewer array.

    Hope this gives direction.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 11 days ago
334 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!