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)
drive_upload()documentation says that file extension is used to determine type whentypeisNULL(see here).This line of code determines the type included in params. It doesn't take into consideration the file extension. When
typeisNULL,drive_mime_typesimply doesn't return anything.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
googledrivepackage to determine the mime type? I was expecting to see something similar to whatdrive_download()has.