Start 2025 on time and up to date. Seamlessly integrate your calendars into Dropbox with these simple steps.

Forum Discussion

samanderson's avatar
samanderson
Explorer | Level 3
10 months ago

Export Folders & Filename List

Hey there! I'm looking for a method to generate a TXT file containing the contents of a publicly shared folder, including both files and subfolders, along with their respective filenames and modification dates. I first attempted to create a script with ChatGPT's help, but couldn't get it to work. Then, I tried using the andreafabrizi/Dropbox-Uploader BASH script, but encountered various issues when trying to run it.

  • Hi samanderson,

    Following your desire, you can do it in 2 nested steps. First you need to enlist all shared links using /2/sharing/list_shared_links and next in recursive way list all nested folders to for all links to shared folders using /2/files/list_folder/continue while keep in mind that the recursion must be organized by you - embedded recursion for links is not supported. Now, you should have links for all files that have (directly or indirectly) pointing shared links and their names as well. For further metadata (modification time and so on) you may call /2/sharing/get_shared_link_metadata for every file link got from the first step. Be aware of different modification dates - client side and server side - you likely need client side.

    The above endpoints can be accessed using any network tool (like curl, for instance) or programing language (either supported by Dropbox or not) able to perform HTTP request (i.e. all in fact). The choice is yours, but I would suggest using Python with the Dropbox Python SDK. 😉

    One more suggestion (or maybe joke): don't rely on AI (they are no so intelligent yet), but rather on your own intelligence! 😀

    Hope this gives direction.

  • Hi samanderson,

    Following your desire, you can do it in 2 nested steps. First you need to enlist all shared links using /2/sharing/list_shared_links and next in recursive way list all nested folders to for all links to shared folders using /2/files/list_folder/continue while keep in mind that the recursion must be organized by you - embedded recursion for links is not supported. Now, you should have links for all files that have (directly or indirectly) pointing shared links and their names as well. For further metadata (modification time and so on) you may call /2/sharing/get_shared_link_metadata for every file link got from the first step. Be aware of different modification dates - client side and server side - you likely need client side.

    The above endpoints can be accessed using any network tool (like curl, for instance) or programing language (either supported by Dropbox or not) able to perform HTTP request (i.e. all in fact). The choice is yours, but I would suggest using Python with the Dropbox Python SDK. 😉

    One more suggestion (or maybe joke): don't rely on AI (they are no so intelligent yet), but rather on your own intelligence! 😀

    Hope this gives direction.