cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right 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: 

how to get file_id, file_size metadata using filename gotten from file chooser (python)

how to get file_id, file_size metadata using filename gotten from file chooser (python)

app5000
Explorer | Level 3
Go to solution

I have used dropbox file chooser to download files and filelinks.  After I extract the filenames using the file chooser, I want to get more extended metadta.

 

To do that I first went through Oauth2, then I used the following python codes:

 

fileid=dbx.files_get_metadata('/'+filename).id

 

but got the following error message:

 

 

  File "/home/serve624/lib/python2.7/site-packages/dropbox/base.py", line 449, in files_get_metadata
    None,
  File "/home/serve624/lib/python2.7/site-packages/dropbox/dropbox.py", line 272, in request
    user_message_locale)
ApiError: ApiError('f865f89a9c9f0c3e53e7319f8d99e3cf', GetMetadataError(u'path', LookupError(u'not_found', None)))

 

Here is another line of python codes:

 

filesize=dbx.files_get_metadata('/'+filename).size

 

 

  File "/home/serve624/lib/python2.7/site-packages/dropbox/base.py", line 449, in files_get_metadata
    None,
  File "/home/serve624/lib/python2.7/site-packages/dropbox/dropbox.py", line 272, in request
    user_message_locale)
ApiError: ApiError('25dcb0204364f0edcc35c33231877b85', GetMetadataError(u'path', LookupError(u'not_found', None)))

 

These two lines of python codes worked for some files from one account but not for files in another account.  I don't know what the error message means.  Could it be that the file path in the () is not correct?  If so how should I compose the file path?  How do I get the correct file path from the file chooser?

 

Thank you for your help.

 

 

 

10 Replies 10

app5000
Explorer | Level 3
Go to solution

Thank you so much.  You have been really helpful.  I am able to get all the metadata I was looking for.  

 

Regards,

 

Q

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    app5000 Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?