guess_content_type: Guess MIME type from filename (extension)

Description Usage Arguments Value Examples

View source: R/guess-content-type.R

Description

Uses an internal database of over 1,800 file extension-to-MIME mappings to return one or more associated types for a given input path. If no match is found, ??? is returned.

Usage

1
guess_content_type(path, not_found = "???", custom_db = NULL)

Arguments

path

path to file

not_found

MIME type to use when the content cannot be guessed by file type.

custom_db

a single data frames each with two columns: mime_type and extension. These sources will be used along with the built-in sources and will take priority over the built-in sources. Note that the extensions should be lower case as they are in the official MIME database.

Value

character vector

Examples

1
guess_content_type(system.file("extdat", "pass-through", "test.pdf", package="wand"))

hrbrmstr/wand documentation built on Sept. 28, 2019, 6:05 a.m.