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: 

Using files_download_to_file method without Metadata.path_lower

Using files_download_to_file method without Metadata.path_lower

MooMoo_polar
Explorer | Level 3
Go to solution

 

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.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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".

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

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".

Здравко
Legendary | Level 20
Go to solution

@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.

MooMoo_polar
Explorer | Level 3
Go to solution

Thank you for the support.

I've tried sharing_get_shared_link_file method and it works well.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    MooMoo_polar Explorer | Level 3
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?