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.
29 lines
961 B
29 lines
961 B
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/get-content-type.R
|
|
\name{get_content_type}
|
|
\alias{get_content_type}
|
|
\title{Discover MIME type of a file based on contents}
|
|
\usage{
|
|
get_content_type(path, ...)
|
|
}
|
|
\arguments{
|
|
\item{path}{path to a file}
|
|
|
|
\item{...}{passed on to \code{\link[=guess_content_type]{guess_content_type()}}}
|
|
}
|
|
\value{
|
|
character vector
|
|
}
|
|
\description{
|
|
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.
|
|
}
|
|
\details{
|
|
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).
|
|
}
|
|
\examples{
|
|
get_content_type(system.file("extdat", "test.pdf", package="wand"))
|
|
}
|
|
|