You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get-content-type.R
\title{Discover MIME type of a file based on contents}
get_content_type(path, guess = TRUE, ...)
\item{path}{path to a file}
\item{guess}{if \code{TRUE} (the default), calls \code{\link[=guess_content_type]{guess_content_type()}} if
no internal rules match the magic header}
\item{...}{passed on to \code{\link[=guess_content_type]{guess_content_type()}} if \code{guess} is \code{TRUE}}
character vector
There are a limited number of header "magic" bytes checked directly by
this function but cover quite a bit of ground. After that, \code{\link[=guess_content_type]{guess_content_type()}}
is called which uses file extension-to-MIME mappings.
File an issue or PR if more magic-byte-level
comparisons are required/desired. If no match is found, \code{???} is returned
(see \code{\link[=guess_content_type]{guess_content_type()}} for how to override this behaviour).
get_content_type(system.file("extdat", "pass-through", "test.pdf", package="wand"))