Skip to content

drive_upload doesn't use file extension when type is NULL #207

@jarodmeng

Description

@jarodmeng

drive_upload() documentation says that file extension is used to determine type when type is NULL (see here).

This line of code determines the type included in params. It doesn't take into consideration the file extension. When type is NULL, drive_mime_type simply doesn't return anything.

params[["mimeType"]] <- drive_mime_type(type)

I might be interpreting the documentation in a wrong way. Does it mean that the extension would be used by Google Drive rather than the googledrive package to determine the mime type? I was expecting to see something similar to what drive_download() has.

ext <- file_ext_safe(path)
export_type <- type %||% ext %||% get_export_mime_type(mime_type)
export_type <- drive_mime_type(export_type)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions