Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Ok I changed my codebase a little bit and now it works perfectly!
Thank your for your efforts.
[Cross-linking for reference: https://stackoverflow.com/questions/75725830/unable-to-list-files-in-shared-dropbox-folder-using-pyt... ]
Which line is resulting in that error? It looks like that error is probably referring to a local filesystem operation, not a Dropbox API call.
Also, while it's probably not related to this particular error, there are some other things to note for the Dropbox API methods:
Hi,
I got an error on line 27 of my code:
---> 27 directories = os.listdir(folder_path)
Do you have any alternative code suggestions? Also, if possible, could you show me where to insert the code changes in my base?
FYI I run the script in Google Colab. Thanks!"
The os.listdir method is a Python method for listing the contents of a particular folder on the local filesystem at the specific path. It accesses the files and folders on the device and a FileNotFoundError error from it would indicate that there is nothing at the local path you specified, in this case using the value in the folder_path variable. The method does not call the Dropbox API and is not made by Dropbox though, so Dropbox can't offer support for that in particular.
I see you are getting the folder_path value from the files_list_folder results. That would only work with os.listdir if the path to the relevant folder on your local machine happened to match the path to it inside your Dropbox account.
I don't have full context on your project or the requirements and constraints you're working under of course, so I can't tell you exactly what code you should write. It may be helpful to step through with a debugger to see what each line is doing and update your code accordingly.
It may also be worth mentioning that if you ultimately want to move or rename files or folders in Dropbox, you can do so directly using the Dropbox API (whether or not you have your Dropbox folder synced to your computer locally), without interacting with the local filesystem. To move or rename a file or folder using the Dropbox API via the Dropbox Python SDK, you would use files_move_v2. And as noted earlier, you can use files_list_folder and files_list_folder_continue to list the contents of a folder (even without a shared link, if the content is in your connected Dropbox account). You may also want to check out the Getting Started and File Access guides.
Thank you for the explanation.
I would like a Python script that can rename all the subdirectories within a specific main directory in my Dropbox account. The subdirectory names are currently in the format 'dd.mm.yyyy', but I would like them to be changed to the format 'yyyy-mm-dd'. I would like to be able to run this script by providing a link to the specific folder in my Dropbox account. If you have any simpler code snippet for it, I'd be happy to see that.
Ok I changed my codebase a little bit and now it works perfectly!
Thank your for your efforts.
The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.
Sound good? Let's get started.Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on Twitter or Facebook.
For more info on available support options, see this article.
If you found the answer to your question, please 'like' the post to say thanks to the user!