Forum Discussion

buttflattery's avatar
buttflattery
Explorer | Level 4
7 years ago
Solved

Detect if a file is an image

I am integrating the dropbox API in my application extension which is a filemanager. I need to check if the file saved on the dropbox server is an image or not. Reason why i need is that i cache the...
  • Greg-DB's avatar
    Greg-DB
    7 years ago

    Right, to be clear, the include_media_info parameter is only deprecated on /2/files/list_folder, not /2/files/get_metadata. And yes, for a substantial number of files, calling /2/files/get_metadata for each one would not be very efficient.

    And that's correct, for the second option I am referring to parsing the file extension from the `name`. And yes, the issue you refer to are the false positives I mentioned.

    No, Dropbox does not validate that a file's extension and content match. The client sets the filename and extension when sending the data, and Dropbox will not reject it if it looks it doesn't match.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!