drive_mime_type

0th

Percentile

Lookup MIME type

This is a helper to determine which MIME type should be used for a file. Three types of input are acceptable:

  • Native Google Drive file types. Important examples:

    • "document" for Google Docs

    • "folder" for folders

    • "presentation" for Google Slides

    • "spreadsheet" for Google Sheets

  • File extensions, such as "pdf", "csv", etc.

  • MIME types accepted by Google Drive (these are simply passed through).

Usage
drive_mime_type(type = NULL)
Arguments
type

Character. Google Drive file type, file extension, or MIME type. Pass the sentinel expose() if you want to get the full table used for validation and lookup, i.e. all MIME types known to be relevant to the Drive API.

Value

Character. MIME type.

Aliases
  • drive_mime_type
Examples
# NOT RUN {
## get the mime type for Google Spreadsheets
drive_mime_type("spreadsheet")

## get the mime type for jpegs
drive_mime_type("jpeg")

## it's vectorized
drive_mime_type(c("presentation", "pdf", "image/gif"))

## see the internal tibble of MIME types known to the Drive API
drive_mime_type(expose())
# }
Documentation reproduced from package googledrive, version 1.0.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.