There is a bug in drive_download() that causes it to fail on KML files depending on the mime type. KML mimeTypes are often text/xml or another raw text input. However, sometimes, depending on how they are loaded onto Drive, they are stored as application/vnd.google-earth.kml+xml.
Since drive_download() checks mimeType with grepl("google", mime_type), KML files are mistakenly assumed to be a directly support mimeType by Google Drive and error is generated from get_export_mime_type since it isn't recognised as a mime type.
#> Error in `get_export_mime_type()`:
#> ! Not a recognized Google MIME type:
#> ✖ application/vnd.google-earth.kml+xml
#> Run `rlang::last_trace()` to see where the error occurred.
I believe that this behavior is not ideal since downloading unsupported mime types should be okay, even if they aren't explicitly supported by the Google Drive API, since get_export_mime_type() is only checked if it appears to explicitly be a Google type. However, I may be wrong there.
Note that this code to check mime_type is also present in drive_read().
There is a bug in
drive_download()that causes it to fail on KML files depending on the mime type. KML mimeTypes are oftentext/xmlor another raw text input. However, sometimes, depending on how they are loaded onto Drive, they are stored asapplication/vnd.google-earth.kml+xml.Since
drive_download()checks mimeType withgrepl("google", mime_type), KML files are mistakenly assumed to be a directly support mimeType by Google Drive and error is generated fromget_export_mime_typesince it isn't recognised as a mime type.I believe that this behavior is not ideal since downloading unsupported mime types should be okay, even if they aren't explicitly supported by the Google Drive API, since
get_export_mime_type()is only checked if it appears to explicitly be a Google type. However, I may be wrong there.Note that this code to check
mime_typeis also present indrive_read().