Guesses the MIME type from a filename extension using the data derived from /etc/mime.types in UNIX-type systems.
This is an R package for mapping filename extensions to MIME
types, based on the data
derived from /etc/mime.types
.
# installationinstall.packages('mime') library(mime)guess_type(c('a/b/c.html', 'd.pdf', 'e.odt', 'foo.docx', 'tex'))# [1] "text/html" # [2] "application/pdf" # [3] "application/vnd.oasis.opendocument.text" # [4] "application/vnd.openxmlformats-officedocument.wordprocessingml.document"# [5] "text/x-tex"
CHANGES IN mime VERSION 0.6
MINOR CHANGES
o Updated the MIME types from Ubuntu 18.04.
CHANGES IN mime VERSION 0.5
MAJOR CHANGES
o the package license was changed from GPL-2 to GPL
CHANGES IN mime VERSION 0.4
NEW FEATURES
o added a new content type: .geojson -> application/vnd.geo+json (thanks, @dmpe, #3)
BUG FIXES
o guess_type() may fail on Windows when the file paths are too long (#2)
CHANGES IN mime VERSION 0.3
NEW FEATURES
o added a few more content types
CHANGES IN mime VERSION 0.2
NEW FEATURES
o added a function parse_multipart() to parse multipart form data submitted via HTTP POST
CHANGES IN mime VERSION 0.1.2
BUG FIXES
o guess_type() returned wrong values for filenames without extensions: it should have used the 'empty' argument.
CHANGES IN mime VERSION 0.1.1
BUG FIXES
o mime::guess_type() may not work when mime is loaded but not attached, because R does not load the mimemap data in this case. Now mimemap is exported in the package namespace.
CHANGES IN mime VERSION 0.1
NEW FEATURES
o The initial version of mime. The main function is mime::guess_type().