drive_extension: Lookup extension from MIME type

View source: R/drive_mime_type.R

drive_extensionR Documentation

Lookup extension from MIME type

Description

This is a helper to determinine which extension should be used for a file. Two types of input are acceptable:

  • MIME types accepted by Google Drive.

  • File extensions, such as "pdf", "csv", etc. (these are simply passed through).

Usage

drive_extension(type = NULL)

Arguments

type

Character. MIME type or file extension.

Value

Character. File extension.

Examples


## get the extension for mime type image/jpeg
drive_extension("image/jpeg")

## it's vectorized
drive_extension(c("text/plain", "pdf", "image/gif"))

tidyverse/googledrive documentation built on Jan. 14, 2024, 3:44 a.m.