Last data update: 2014.03.03

R: Mapping from extension to MIME type
mimeTypeExtensionsR Documentation

Mapping from extension to MIME type

Description

This is a programmatically generated character vector whose names identify the MIME type typically associated with the extension which are the values. This is used in guessMIMEType. We can match an extension and then find the corresponding MIME type. There are duplicates.

Usage

data(mimeTypeExtensions)

Format

The format is a named character vector where the names are the MIME types and the values are the file extensions.

Source

The table of MIME types and extensions was programmatically extracted from http://www.webmaster-toolkit.com/mime-types.shtml or http://reference.sitepoint.com/html/mime-types-full with tbls = readHTMLTable("http://www.webmaster-toolkit.com/mime-types.shtml") tmp = tbls[[1]][-1,] mimeTypeExtensions = structure(as.character(tmp[[2]]), names = gsub("^.", "", tmp[[1]])) save(mimeTypeExtensions, file = "data/mimeTypeExtensions.rda") The IANA list is not as convenient to programmatically compile.

Examples

data(mimeTypeExtensions)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RCurl)
Loading required package: bitops
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RCurl/mimeTypeExtensions.Rd_%03d_medium.png", width=480, height=480)
> ### Name: mimeTypeExtensions
> ### Title: Mapping from extension to MIME type
> ### Aliases: mimeTypeExtensions
> ### Keywords: datasets
> 
> ### ** Examples
> 
> data(mimeTypeExtensions)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>