You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
buttflattery
6 years agoExplorer | Level 4
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...
- 6 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.
buttflattery
Explorer | Level 4
Oops! i mixed the include_media_info option of the list_folder with the meta_data assuming the include_media_info option is going to be deprecated. But this option wont be much efficient and will make the process delayed in case of files are more than 100 or so along with consuming too much API calls.
About the second option i didnt quiet get what you are saying. Do you mean that i should extract the extension from the the name and match it with the supported file types? Wont that be unreliable just to rely on the name as it could be changed to anything like i change a .jpg image to a .pdf file then what?
Does dropbox validates a file based on its extension and content both when we save there and rejects it?
Greg-DB
6 years agoDropbox Staff
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.
- buttflattery6 years agoExplorer | Level 4
Although it is not a solution but a limitation i must say on dropbox end and this is not an optimal approach but anyhow there isnt any other thing i can do. so marking it as an answer.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,911 PostsLatest Activity: 6 hours agoIf 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!