Skip to content

drive_download() error with KML mimeType #441

Description

@caldwellst

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().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions