drive_extension: Lookup extension from MIME type

Description Usage Arguments Value Examples

View source: R/drive_mime_type.R

Description

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

Usage

1

Arguments

type

Character. MIME type or file extension.

Value

Character. File extension.

Examples

1
2
3
4
5
## get the extension for mime type image/jpeg
drive_extension("image/jpeg")

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

googledrive documentation built on July 8, 2021, 5:07 p.m.