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

Forum Discussion

MooMoo_polar's avatar
MooMoo_polar
Explorer | Level 3
11 months ago

Using files_download_to_file method without Metadata.path_lower

 

Hello. I would like to download 900+ files in the shared link folder using python SDK.

 

I use files_download_to_file method which required Metadata.path_lower from files_list_folder method.
However, when I print a file's value from files_list_folder, the path_lower returns None value.

 

I'm curious how could I download files without Metadata.path_lower using files_download_to_file method, or any other download method is okay.

I would like to make the script to run automatically.

 

Thank you in advance.

  • If that path values are not set, that indicates that the item is not mounted under the account/root for that call. For example, you may be using an access token for an account that doesn't contain that linked item.

     

    To download a file from a shared link for a folder containing that file, you should use the sharing_get_shared_link_file method. The 'url' parameter should be the shared link to the folder, and the 'path' parameter should be the relative path to the desired file inside that folder, which you can build from the 'name' values of the entries returned by files_list_folder/files_list_folder_continue. For example, if the linked folder contains a file named "file.ext", the "path" would be "/file.ext". Or, for example, if the linked folder contains a subfolder named "subfolder", and that subfolder contains a file named "file.ext", the "path" would be
    "/subfolder/file.ext".

  • If that path values are not set, that indicates that the item is not mounted under the account/root for that call. For example, you may be using an access token for an account that doesn't contain that linked item.

     

    To download a file from a shared link for a folder containing that file, you should use the sharing_get_shared_link_file method. The 'url' parameter should be the shared link to the folder, and the 'path' parameter should be the relative path to the desired file inside that folder, which you can build from the 'name' values of the entries returned by files_list_folder/files_list_folder_continue. For example, if the linked folder contains a file named "file.ext", the "path" would be "/file.ext". Or, for example, if the linked folder contains a subfolder named "subfolder", and that subfolder contains a file named "file.ext", the "path" would be
    "/subfolder/file.ext".

    • MooMoo_polar's avatar
      MooMoo_polar
      Explorer | Level 3

      Thank you for the support.

      I've tried sharing_get_shared_link_file method and it works well.

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

    MooMoo_polar wrote:

    ...

    I'm curious how could I download files without Metadata.path_lower using files_download_to_file method, or any other download method is okay.

    I would like to make the script to run automatically.

    ...


    Hi MooMoo_polar,

    A way to do what you want can be seen here. 😉

    Hope this helps.