One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
Mgymnasts
2 years agoExplorer | Level 4
dbx.files_move Error
I am getting Error listing folder contents: ApiError('NUMBERSANDLETTERS', ListFolderError('path', LookupError('not_folder', None)))
This comes from this line of code:
dbx.files_move(source_path, destination_path)
I believe I am getting this error because of the to_path. Is that how I should read this error statement?
My file structure on dropbox is Parent Folder/Apps/Child Folder/Processed
The from_path is '/Child Folder/Grandchild Folder/filename.csv'
I have tried the to_path = '/Child Folder/Processed', to_path ='/Child Folder/Processed', to_path = "/Child Folder/Processed/filename.csv', to_path = "/Child Folder/Processed/filename.csv/" and all have given the same error. I appreciate any help!
- ЗдравкоLegendary | Level 20
Hi Mgymnasts,
As seems, you're trying to list some file. 🙂 Only folders can be listed! When you perform list to the folder where particular file resides in, you will get that file information together with all other. Of course, you can get the file metadata directly if that's what you want, using corresponding method. By the way, this has nothing to do with the move.
- Greg-DB
Dropbox Staff
Mgymnasts Здравко is correct; while you mentioned using the 'files_move' method, the error output you showed contains a 'ListFolderError'. A ListFolderError would come from files_list_folder (or files_list_folder_get_latest_cursor). For comparison, files_move would raise a RelocationError. You can see the return and error types for each in the documentation linked there for each method.
So, that error is not coming from that particular line of code. In any case, the error itself means that the list_folder call failed because you supplied a path to something that isn't a folder; only folders can be listed like that. (If you want to get the metadata for a specific file, you would use files_get_metadata instead.)
By the way, you should use the newer files_move_v2 instead of files_move.
- MgymnastsExplorer | Level 4
Looking to clarify: If I want to move a file from one folder to another, I should use files_move_v2 (from, to) where the from is the folder where the file is but this path doesn't include the file, and then the to folder is only the folder. Where do I clarify which file I am moving? Or would this move all files in that folder?
- Greg-DB
Dropbox Staff
Mgymnasts When using files_move_v2, the 'from_path' should be the full path of the item you want to move.
If you want to move an entire folder and its contents, you would specify the 'from_path' like '/Child Folder/Grandchild Folder', which would move just 'Grandchild Folder' and its contents, or '/Child Folder', which would move 'Child Folder' and its contents, which would also include 'Grandchild Folder' in this example.
If you want to move a specific file only, you would specify the 'from_path' like '/Child Folder/Grandchild Folder/filename.csv'.
Likewise, the 'to_path' should be the full path of where you want to put the item, either a folder path or a file path accordingly. For example, to move a specific file only that would be like '/Child Folder/Processed/filename.csv'.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 3 hours ago
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!