I’m working on an iOS application that retrieves files from Google Drive API. After getting the response data, I need to sort and filter the files based on their types. However, I’m running into issues with the MIME type values I’m receiving.
The documentation suggests that image files should have the MIME type “application/vnd.google-apps.photo”, but when I check the actual API response, I’m getting “image/jpeg” instead. This mismatch is causing problems with my filtering logic.
Has anyone encountered similar inconsistencies between the documented MIME types and the actual values returned by the Google Drive API? Where can I find accurate information about the MIME types that are actually sent in the response?
I ran into the same issue when building a file management feature. Google Drive actually uses two different MIME type systems depending on where the file came from. Native Google Workspace files get the “application/vnd.google-apps.*” format, but uploaded files keep their original MIME types like “image/jpeg”. Since you’re working with uploaded images, that’s why you’re seeing “image/jpeg” instead of Google’s format. I’d suggest writing a function that checks for “vnd.google-apps” types first, then falls back to regular MIME types. The docs mention both formats but don’t really explain when to use which one.
same thing happened 2 me last month! google drive handles uploaded files different than stuff created directly in their apps. upload a JPEG and it stays image/jpeg, but create smth in google photos and u get vnd.google-apps.photo. i just check for both in my switch statement - works perfectly.
Google Drive handles file types in two different ways, which causes the confusion. Regular files uploaded through the API or web interface keep their normal MIME types - image/jpeg, video/mp4, application/pdf, etc. But files created directly in Google’s apps get the vnd.google-apps namespace instead. I ran into this same issue when debugging a filtering system. What helped was checking where the file came from - that tells you which MIME type format you’ll get. My advice? Build a mapping function that converts both formats to your own internal categories. Trust me, it’ll save you tons of debugging headaches when users upload files different ways.