├── VERSION ├── spec ├── fixtures │ ├── file.jpg │ ├── file.rb │ └── file.unknown ├── spec_helper.rb └── mime_type_spec.rb ├── install.rb ├── uninstall.rb ├── lib ├── extensions_const.rb ├── mimetype_fu.rb └── mime_types.yml ├── init.rb ├── tasks └── mimetype_fu_tasks.rake ├── test └── mimetype_fu_test.rb ├── README ├── MIT-LICENSE ├── Rakefile └── mimetype-fu.gemspec /VERSION: -------------------------------------------------------------------------------- 1 | 0.1.0 2 | -------------------------------------------------------------------------------- /spec/fixtures/file.jpg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/file.rb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/file.unknown: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /install.rb: -------------------------------------------------------------------------------- 1 | # Install hook code here 2 | -------------------------------------------------------------------------------- /uninstall.rb: -------------------------------------------------------------------------------- 1 | # Uninstall hook code here 2 | -------------------------------------------------------------------------------- /lib/extensions_const.rb: -------------------------------------------------------------------------------- 1 | EXTENSIONS = YAML.load_file(File.dirname(__FILE__) + '/mime_types.yml').symbolize_keys -------------------------------------------------------------------------------- /init.rb: -------------------------------------------------------------------------------- 1 | require File.dirname(__FILE__) + '/lib/extensions_const' 2 | require File.dirname(__FILE__) + '/lib/mimetype_fu' -------------------------------------------------------------------------------- /tasks/mimetype_fu_tasks.rake: -------------------------------------------------------------------------------- 1 | # desc "Explaining what the task does" 2 | # task :mimetype_fu do 3 | # # Task goes here 4 | # end 5 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] = "test" 2 | require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment") 3 | require 'test_help' 4 | 5 | -------------------------------------------------------------------------------- /test/mimetype_fu_test.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | class MimetypeFuTest < Test::Unit::TestCase 4 | # Replace this with your real tests. 5 | def test_this_plugin 6 | flunk 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | MimetypeFu 2 | ========== 3 | 4 | Some great Rails plugins like attachment_fu use the content type/mime type of a file to validate the instance of an object. 5 | The plugin usually gets the mime type using the CGI request, however, if the file is already in the system, this approach won't work. 6 | Adobe Flash is also known not to send the proper mime type. 7 | As an alternative, I wrote mimetype_fu, a simple plugin which will try to guess the mimetype of a file based on its extension. 8 | 9 | Note that mimetype_fu only looks at the extension to define its mime type if you are using Windows! 10 | 11 | http://github.com/mattetti/mimetype-fu 12 | 13 | Thanks to forestcarlisle for his big report and patch. 14 | 15 | 16 | Copyright (c) 2008 Matt Aimonetti, released under the MIT license 17 | -------------------------------------------------------------------------------- /lib/mimetype_fu.rb: -------------------------------------------------------------------------------- 1 | class File 2 | 3 | def self.mime_type?(file) 4 | case file 5 | when File, Tempfile 6 | unless RUBY_PLATFORM.include? 'mswin32' 7 | mime = `file --mime -br #{file.path}`.strip 8 | else 9 | mime = EXTENSIONS[File.extname(file.path).gsub('.','').downcase.to_sym] 10 | end 11 | when String 12 | mime = EXTENSIONS[(file[file.rindex('.')+1, file.size]).downcase.to_sym] 13 | when StringIO 14 | temp = File.open(Dir.tmpdir + '/upload_file.' + Process.pid.to_s, "wb") 15 | temp << file.string 16 | temp.close 17 | mime = `file --mime -br #{temp.path}` 18 | mime = mime.gsub(/^.*: */,"") 19 | mime = mime.gsub(/;.*$/,"") 20 | mime = mime.gsub(/,.*$/,"") 21 | File.delete(temp.path) 22 | end 23 | return mime || 'unknown/unknown' 24 | end 25 | 26 | 27 | def self.extensions 28 | EXTENSIONS 29 | end 30 | 31 | end 32 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 [name of plugin creator] 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rake/testtask' 3 | require 'rake/rdoctask' 4 | 5 | begin 6 | require 'jeweler' 7 | Jeweler::Tasks.new do |gem| 8 | gem.name = "mimetype-fu" 9 | gem.summary = "get the mimetype of a file directly in Ruby" 10 | gem.email = "josh@vitamin-j.com" 11 | gem.homepage = "http://github.com/jfrench/mimetype-fu" 12 | gem.authors = ["Josh French"] 13 | end 14 | 15 | rescue LoadError 16 | puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler" 17 | end 18 | 19 | desc 'Default: run unit tests.' 20 | task :default => :test 21 | 22 | desc 'Test the mimetype_fu plugin.' 23 | Rake::TestTask.new(:test) do |t| 24 | t.libs << 'lib' 25 | t.pattern = 'test/**/*_test.rb' 26 | t.verbose = true 27 | end 28 | 29 | desc 'Generate documentation for the mimetype_fu plugin.' 30 | Rake::RDocTask.new(:rdoc) do |rdoc| 31 | rdoc.rdoc_dir = 'rdoc' 32 | rdoc.title = 'MimetypeFu' 33 | rdoc.options << '--line-numbers' << '--inline-source' 34 | rdoc.rdoc_files.include('README') 35 | rdoc.rdoc_files.include('lib/**/*.rb') 36 | end 37 | 38 | begin 39 | require 'rcov/rcovtask' 40 | Rcov::RcovTask.new do |test| 41 | test.libs << 'test' 42 | test.pattern = 'test/**/*_test.rb' 43 | test.verbose = true 44 | end 45 | rescue LoadError 46 | task :rcov do 47 | abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" 48 | end 49 | end -------------------------------------------------------------------------------- /spec/mime_type_spec.rb: -------------------------------------------------------------------------------- 1 | require File.dirname(__FILE__) + '/spec_helper' 2 | require File.dirname(__FILE__) + '/../lib/mimetype_fu' 3 | 4 | describe 'A file with a know extension' do 5 | 6 | before(:each) do 7 | @file = File.open(File.dirname(__FILE__) + '/fixtures/file.jpg') 8 | end 9 | 10 | it 'should have an extension' do 11 | File.extname(@file.path).should == '.jpg' 12 | end 13 | 14 | it 'should have a mime type' do 15 | File.mime_type?(@file).should == "image/jpeg" 16 | end 17 | 18 | end 19 | 20 | describe 'A file with anunknow extension' do 21 | 22 | before(:each) do 23 | @file = File.open(File.dirname(__FILE__) + '/fixtures/file.unknown') 24 | end 25 | 26 | it 'should have an extension' do 27 | File.extname(@file.path).should == '.unknown' 28 | end 29 | 30 | it 'should have an unkwown mime type' do 31 | File.mime_type?(@file).should == "unknown/unknown" 32 | end 33 | 34 | end 35 | 36 | describe 'A valid file path' do 37 | 38 | before(:each) do 39 | @file_path = "#{Dir.pwd} + /picture.png" 40 | end 41 | 42 | it 'should have a mime type' do 43 | File.mime_type?(@file_path).should == "image/png" 44 | end 45 | 46 | end 47 | 48 | describe "An unknown extension" do 49 | 50 | before(:each) do 51 | @file_path = 'file.unknown' 52 | end 53 | 54 | it 'should have an unknown mime type' do 55 | File.mime_type?(@file_path).should == "unknown/unknown" 56 | end 57 | end -------------------------------------------------------------------------------- /mimetype-fu.gemspec: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | 3 | Gem::Specification.new do |s| 4 | s.name = %q{mimetype-fu} 5 | s.version = "0.1.0" 6 | 7 | s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= 8 | s.authors = ["Josh French"] 9 | s.date = %q{2009-06-09} 10 | s.email = %q{josh@vitamin-j.com} 11 | s.extra_rdoc_files = [ 12 | "README" 13 | ] 14 | s.files = [ 15 | "MIT-LICENSE", 16 | "README", 17 | "Rakefile", 18 | "VERSION", 19 | "init.rb", 20 | "install.rb", 21 | "lib/extensions_const.rb", 22 | "lib/mime_types.yml", 23 | "lib/mimetype_fu.rb", 24 | "spec/fixtures/file.jpg", 25 | "spec/fixtures/file.rb", 26 | "spec/fixtures/file.unknown", 27 | "spec/mime_type_spec.rb", 28 | "spec/spec_helper.rb", 29 | "tasks/mimetype_fu_tasks.rake", 30 | "test/mimetype_fu_test.rb", 31 | "uninstall.rb" 32 | ] 33 | s.homepage = %q{http://github.com/jfrench/mimetype-fu} 34 | s.rdoc_options = ["--charset=UTF-8"] 35 | s.require_paths = ["lib"] 36 | s.rubygems_version = %q{1.3.4} 37 | s.summary = %q{TODO} 38 | s.test_files = [ 39 | "spec/fixtures/file.rb", 40 | "spec/mime_type_spec.rb", 41 | "spec/spec_helper.rb", 42 | "test/mimetype_fu_test.rb" 43 | ] 44 | 45 | if s.respond_to? :specification_version then 46 | current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION 47 | s.specification_version = 3 48 | 49 | if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then 50 | else 51 | end 52 | else 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /lib/mime_types.yml: -------------------------------------------------------------------------------- 1 | # EXTENSIONS => CONTENT TYPE 2 | \"123\": application/vnd.lotus-1-2-3 3 | \"602\": application/x-t602 4 | \"669\": audio/x-mod 5 | 3ds: image/x-3ds 6 | 3g2: video/3gpp2 7 | 3gp: video/3gpp 8 | 3gpp: video/3gpp 9 | 7z: application/x-7z-compressed 10 | a: application/x-archive 11 | aac: audio/mp4 12 | abw: application/x-abiword 13 | ac3: audio/ac3 14 | ace: application/x-ace 15 | acutc: application/vnd.acucorp 16 | adb: text/x-adasrc 17 | ads: text/x-adasrc 18 | afm: application/x-font-afm 19 | ag: image/x-applix-graphics 20 | ai: application/illustrator 21 | aif: audio/x-aiff 22 | aifc: audio/x-aiff 23 | aiff: audio/x-aiff 24 | al: application/x-perl 25 | ami: application/vnd.amiga.ami 26 | amr: audio/AMR 27 | ani: application/octet-stream 28 | ape: audio/x-ape 29 | arj: application/x-arj 30 | arw: image/x-sony-arw 31 | as: application/x-applix-spreadsheet 32 | asc: application/pgp-encrypted 33 | asf: video/x-ms-asf 34 | asp: application/x-asp 35 | ass: text/x-ssa 36 | asx: audio/x-ms-asx 37 | atc: application/vnd.acucorp 38 | atom: application/atom+xml 39 | au: audio/basic 40 | avi: video/x-msvideo 41 | aw: application/x-applix-word 42 | awb: audio/AMR-WB 43 | bak: application/x-trash 44 | bcpio: application/x-bcpio 45 | bdf: application/x-font-bdf 46 | bib: text/x-bibtex 47 | bin: application/x-mac 48 | bkm: application/vnd.nervana 49 | blend: application/x-blender 50 | blender: application/x-blender 51 | bmp: image/bmp 52 | bpd: application/vnd.hbci 53 | builder: application/x-ruby 54 | bz: application/x-bzip 55 | bz2: application/x-bzip 56 | c: text/x-csrc 57 | c++: text/x-c++src 58 | cab: application/vnd.ms-cab-compressed 59 | cbr: application/x-cbr 60 | cbz: application/x-cbz 61 | cc: text/x-c++src 62 | ccc: text/vnd.net2phone.commcenter.command 63 | cdf: application/x-netcdf 64 | cdr: application/vnd.corel-draw 65 | cdy: application/vnd.cinderella 66 | cer: application/x-x509-ca-cert 67 | cert: application/x-x509-ca-cert 68 | cgi: application/x-cgi 69 | cgm: image/cgm 70 | chm: application/x-chm 71 | chrt: application/x-kchart 72 | chrt: application/vnd.kde.kchart 73 | cil: application/vnd.ms-artgalry 74 | class: application/x-java 75 | cls: text/x-tex 76 | cmc: application/vnd.cosmocaller 77 | cpio: application/x-cpio 78 | cpp: text/x-c++src 79 | cr2: image/x-canon-cr2 80 | crl: application/pkix-crl 81 | crt: application/x-x509-ca-cert 82 | crw: image/x-canon-crw 83 | cs: text/x-csharp 84 | csh: application/x-csh 85 | css: text/css 86 | cssl: text/css 87 | csv: text/csv 88 | cue: application/x-cue 89 | cur: image/x-win-bitmap 90 | curl: application/vnd.curl 91 | cw: application/prs.cww 92 | cww: application/prs.cww 93 | cxx: text/x-c++src 94 | d: text/x-dsrc 95 | dar: application/x-dar 96 | dat: text/plain 97 | dbf: application/x-dbf 98 | dc: application/x-dc-rom 99 | dcl: text/x-dcl 100 | dcm: application/dicom 101 | dcr: image/x-kodak-dcr 102 | dds: image/x-dds 103 | deb: application/x-deb 104 | der: application/x-x509-ca-cert 105 | desktop: application/x-desktop 106 | dfac: application/vnd.dreamfactory 107 | dgn: image/x-vnd.dgn 108 | dia: application/x-dia-diagram 109 | diff: text/x-patch 110 | divx: video/x-msvideo 111 | djv: image/vnd.djvu 112 | djvu: image/vnd.djvu 113 | dl: video/dl 114 | dms: application/octet-stream 115 | dng: image/x-adobe-dng 116 | doc: application/msword 117 | docx: application/msword 118 | docbook: application/docbook+xml 119 | dot: application/msword 120 | dsl: text/x-dsl 121 | dtd: text/x-dtd 122 | dtx: text/x-tex 123 | dv: video/dv 124 | dvi: application/x-dvi 125 | dwf: x-drawing/dwf 126 | dwg: image/vnd.dwg 127 | dxf: image/vnd.dxf 128 | ecelp4800: audio/vnd.nuera.ecelp4800 129 | ecelp7470: audio/vnd.nuera.ecelp7470 130 | ecelp9600: audio/vnd.nuera.ecelp9600 131 | efif: application/vnd.picsel 132 | egon: application/x-egon 133 | el: text/x-emacs-lisp 134 | emf: image/x-emf 135 | emm: application/vnd.ibm.electronic-media 136 | emp: application/vnd.emusic-emusic_package 137 | ent: application/vnd.nervana 138 | entity: application/vnd.nervana 139 | eol: audio/vnd.digital-winds 140 | eps: image/x-eps 141 | epsf: image/x-eps 142 | epsi: image/x-eps 143 | erb: text/rhtml 144 | erl: text/x-erlang 145 | es: application/ecmascript 146 | etheme: application/x-e-theme 147 | etx: text/x-setext 148 | evc: audio/EVRC 149 | exe: application/x-executable 150 | ez: application/andrew-inset 151 | fig: image/x-xfig 152 | fits: image/x-fits 153 | flac: audio/x-flac 154 | flc: video/x-flic 155 | fli: video/x-flic 156 | flo: application/vnd.micrografx.flo 157 | flv: application/x-flash-video 158 | flw: application/x-kivio 159 | fo: text/x-xslfo 160 | for: text/x-fortran 161 | fsc: application/vnd.fsc.weblaunch 162 | g3: image/fax-g3 163 | gb: application/x-gameboy-rom 164 | gba: application/x-gba-rom 165 | gcrd: text/directory 166 | ged: application/x-gedcom 167 | gedcom: application/x-gedcom 168 | gen: application/x-genesis-rom 169 | gf: application/x-tex-gf 170 | gg: application/x-sms-rom 171 | gif: image/gif 172 | gif: image/gif 173 | gl: video/gl 174 | glade: application/x-glade 175 | gmo: application/x-gettext-translation 176 | gnc: application/x-gnucash 177 | gnucash: application/x-gnucash 178 | gnumeric: application/x-gnumeric 179 | gnuplot: application/x-gnuplot 180 | gp: application/x-gnuplot 181 | gpg: application/pgp-encrypted 182 | gplt: application/x-gnuplot 183 | gra: application/x-graphite 184 | gsf: application/x-font-type1 185 | gtar: application/x-tar 186 | gvp: text/x-google-video-pointer 187 | gz: application/x-gzip 188 | h: text/x-chdr 189 | h++: text/x-c++hdr 190 | hbc: application/vnd.hbci 191 | hbci: application/vnd.hbci 192 | hdf: application/x-hdf 193 | hh: text/x-c++hdr 194 | hh: text/plain 195 | hlp: text/plain 196 | hp: text/x-c++hdr 197 | hpgl: application/vnd.hp-hpgl 198 | hpp: text/x-c++hdr 199 | hqx: application/mac-binhex40 200 | hs: text/x-haskell 201 | htke: application/vnd.kenameaapp 202 | htm: text/html 203 | html: text/html 204 | htmlx: text/html 205 | htx: text/html 206 | hvd: application/vnd.yamaha.hv-dic 207 | hvp: application/vnd.yamaha.hv-voice 208 | hvs: application/vnd.yamaha.hv-script 209 | hwp: application/x-hwp 210 | hwt: application/x-hwt 211 | hxx: text/x-c++hdr 212 | ica: application/x-ica 213 | icb: image/x-tga 214 | ice: x-conference/x-cooltalk 215 | icns: image/x-icns 216 | ico: image/x-ico 217 | ics: text/calendar 218 | idl: text/x-idl 219 | ief: image/ief 220 | iff: image/x-iff 221 | iges: model/iges 222 | igs: model/iges 223 | igx: application/vnd.micrografx.igx 224 | ilbm: image/x-ilbm 225 | ins: text/x-tex 226 | irm: application/vnd.ibm.rights-management 227 | irp: application/vnd.irepository.package+xml 228 | iso: application/x-cd-image 229 | iso9660: application/x-cd-image 230 | it: audio/x-it 231 | j2k: image/jp2 232 | jad: text/vnd.sun.j2me.app-descriptor 233 | jar: application/x-java-archive 234 | java: text/x-java 235 | jisp: application/vnd.jisp 236 | jng: image/x-jng 237 | jnlp: application/x-java-jnlp-file 238 | jp2: image/jp2 239 | jpc: image/jp2 240 | jpe: image/jpeg 241 | jpeg: image/jpeg 242 | jpf: image/jp2 243 | jpg: image/jpeg 244 | jpm: image/jpm 245 | jpr: application/x-jbuilder-project 246 | jpx: image/jpx 247 | js: application/javascript 248 | k25: image/x-kodak-k25 249 | kar: audio/midi 250 | karbon: application/x-karbon 251 | kcm: application/vnd.nervana 252 | kdc: image/x-kodak-kdc 253 | kdelnk: application/x-desktop 254 | kfo: application/x-kformula 255 | kia: application/vnd.kidspiration 256 | kil: application/x-killustrator 257 | kino: application/smil 258 | kne: application/vnd.Kinar 259 | knp: application/vnd.Kinar 260 | kom: application/vnd.hbci 261 | kon: application/x-kontour 262 | kon: application/vnd.kde.kontour 263 | kpm: application/x-kpovmodeler 264 | kpr: application/x-kpresenter 265 | kpt: application/x-kpresenter 266 | kra: application/x-krita 267 | ksp: application/x-kspread 268 | kud: application/x-kugar 269 | kwd: application/x-kword 270 | kwt: application/x-kword 271 | l16: audio/L16 272 | la: application/x-shared-library-la 273 | latex: text/x-tex 274 | lbd: application/vnd.llamagraphics.life-balance.desktop 275 | lbe: application/vnd.llamagraphics.life-balance.exchange+xml 276 | ldif: text/x-ldif 277 | les: application/vnd.hhe.lesson-player 278 | lha: application/x-lha 279 | lhs: text/x-literate-haskell 280 | lhz: application/x-lhz 281 | log: text/x-log 282 | lrm: application/vnd.ms-lrm 283 | ltx: text/x-tex 284 | lua: text/x-lua 285 | lvp: audio/vnd.lucent.voice 286 | lwo: image/x-lwo 287 | lwob: image/x-lwo 288 | lws: image/x-lws 289 | lyx: application/x-lyx 290 | lzh: application/x-lha 291 | lzo: application/x-lzop 292 | m: text/x-objcsrc 293 | m15: audio/x-mod 294 | m2t: video/mpeg 295 | m3u: audio/x-mpegurl 296 | m4: application/x-m4 297 | m4a: audio/mp4 298 | m4b: audio/x-m4b 299 | m4u: video/vnd.mpegurl 300 | m4v: video/mp4 301 | mab: application/x-markaby 302 | man: application/x-troff-man 303 | mcd: application/vnd.mcd 304 | md: application/x-genesis-rom 305 | mdb: application/vnd.ms-access 306 | mdi: image/vnd.ms-modi 307 | me: text/x-troff-me 308 | me: application/x-troff-me 309 | mesh: model/mesh 310 | mfm: application/vnd.mfmp 311 | mgp: application/x-magicpoint 312 | mid: audio/midi 313 | midi: audio/midi 314 | mif: application/x-mif 315 | minipsf: audio/x-minipsf 316 | mj2: video/MJ2 317 | mjp2: video/MJ2 318 | mka: audio/x-matroska 319 | mkv: video/x-matroska 320 | ml: text/x-ocaml 321 | mli: text/x-ocaml 322 | mm: text/x-troff-mm 323 | mmf: application/vnd.smaf 324 | mml: text/mathml 325 | mng: video/x-mng 326 | mo: application/x-gettext-translation 327 | moc: text/x-moc 328 | mod: audio/x-mod 329 | moov: video/quicktime 330 | mov: video/quicktime 331 | movie: video/x-sgi-movie 332 | \"mp+\": audio/x-musepack 333 | mp2: audio/mp2 334 | mp2: video/mpeg 335 | mp3: audio/mpeg 336 | mp3g: video/mpeg 337 | mp4: video/mp4 338 | mpc: audio/x-musepack 339 | mpe: video/mpeg 340 | mpeg: video/mpeg 341 | mpg: video/mpeg 342 | mpga: audio/mpeg 343 | mpm: application/vnd.blueice.multipass 344 | mpn: application/vnd.mophun.application 345 | mpp: application/vnd.ms-project 346 | mrw: image/x-minolta-mrw 347 | ms: text/x-troff-ms 348 | mseq: application/vnd.mseq 349 | msh: model/mesh 350 | msod: image/x-msod 351 | msx: application/x-msx-rom 352 | mtm: audio/x-mod 353 | mup: text/x-mup 354 | mxmf: audio/vnd.nokia.mobile-xmf 355 | mxu: video/vnd.mpegurl 356 | n64: application/x-n64-rom 357 | nb: application/mathematica 358 | nc: application/x-netcdf 359 | nds: application/x-nintendo-ds-rom 360 | nef: image/x-nikon-nef 361 | nes: application/x-nes-rom 362 | nfo: text/x-readme 363 | nim: video/vnd.nokia.interleaved-multimedia 364 | not: text/x-mup 365 | nsc: application/x-netshow-channel 366 | nsv: video/x-nsv 367 | o: application/x-object 368 | obj: application/x-tgif 369 | ocl: text/x-ocl 370 | oda: application/oda 371 | odb: application/vnd.oasis.opendocument.database 372 | odc: application/vnd.oasis.opendocument.chart 373 | odf: application/vnd.oasis.opendocument.formula 374 | odg: application/vnd.oasis.opendocument.graphics 375 | odi: application/vnd.oasis.opendocument.image 376 | odm: application/vnd.oasis.opendocument.text-master 377 | odp: application/vnd.oasis.opendocument.presentation 378 | ods: application/vnd.oasis.opendocument.spreadsheet 379 | odt: application/vnd.oasis.opendocument.text 380 | oga: audio/ogg 381 | ogg: application/ogg 382 | ogm: video/x-ogm+ogg 383 | ogv: video/ogg 384 | ogx: application/ogg 385 | old: application/x-trash 386 | oleo: application/x-oleo 387 | opml: text/x-opml+xml 388 | oprc: application/vnd.palm 389 | orf: image/x-olympus-orf 390 | otg: application/vnd.oasis.opendocument.graphics-template 391 | oth: application/vnd.oasis.opendocument.text-web 392 | otp: application/vnd.oasis.opendocument.presentation-template 393 | ots: application/vnd.oasis.opendocument.spreadsheet-template 394 | ott: application/vnd.oasis.opendocument.text-template 395 | owl: text/rdf 396 | p: text/x-pascal 397 | p10: application/pkcs10 398 | p12: application/x-pkcs12 399 | p7c: application/pkcs7-mime 400 | p7m: application/pkcs7-mime 401 | p7s: application/pkcs7-signature 402 | pak: application/x-pak 403 | par2: application/x-par2 404 | pas: text/x-pascal 405 | patch: text/x-patch 406 | pbm: image/x-portable-bitmap 407 | pcd: image/x-photo-cd 408 | pcf: application/x-font-pcf 409 | pcl: application/vnd.hp-pcl 410 | pdb: application/x-palm-database 411 | pdf: application/pdf 412 | pef: image/x-pentax-pef 413 | pem: application/x-x509-ca-cert 414 | perl: application/x-perl 415 | pfa: application/x-font-type1 416 | pfb: application/x-font-type1 417 | pfr: application/font-tdpfr 418 | pfx: application/x-pkcs12 419 | pgb: image/vnd.globalgraphics.pgb 420 | pgm: image/x-portable-graymap 421 | pgn: application/x-chess-pgn 422 | pgp: application/pgp-encrypted 423 | php: application/x-php 424 | php3: application/x-php 425 | php4: application/x-php 426 | pict: image/x-pict 427 | pict1: image/x-pict 428 | pict2: image/x-pict 429 | pk: application/x-tex-pk 430 | pkd: application/vnd.hbci 431 | pki: application/pkixcmp 432 | pkipath: application/pkix-pkipath 433 | pkr: application/pgp-keys 434 | pl: application/x-perl 435 | pla: audio/x-iriver-pla 436 | plb: application/vnd.3gpp.pic-bw-large 437 | plj: audio/vnd.everad.plj 438 | pln: application/x-planperfect 439 | pls: audio/x-scpls 440 | plt: application/vnd.hp-HPGL 441 | pm: application/x-perl 442 | png: image/png 443 | pnm: image/x-portable-anymap 444 | pntg: image/x-macpaint 445 | po: text/x-gettext-translation 446 | pot: application/vnd.ms-powerpoint 447 | ppm: image/x-portable-pixmap 448 | pps: application/vnd.ms-powerpoint 449 | ppt: application/vnd.ms-powerpoint 450 | pptx: application/vnd.ms-powerpoint 451 | ppz: application/vnd.ms-powerpoint 452 | pqa: application/vnd.palm 453 | prc: application/x-palm-database 454 | ps: application/postscript 455 | psb: application/vnd.3gpp.pic-bw-small 456 | psd: image/x-psd 457 | psf: application/x-font-linux-psf 458 | psf: audio/x-psf 459 | psflib: audio/x-psflib 460 | psid: audio/prs.sid 461 | psp: image/x-paintshoppro 462 | pspimage: image/x-paintshoppro 463 | pti: application/vnd.pvi.ptid1 464 | ptid: application/vnd.pvi.ptid1 465 | pvb: application/vnd.3gpp.pic-bw-var 466 | pw: application/x-pw 467 | py: text/x-python 468 | pyc: application/x-python-bytecode 469 | pyo: application/x-python-bytecode 470 | qcp: audio/QCELP 471 | qif: image/x-quicktime 472 | qt: video/quicktime 473 | qtif: image/x-quicktime 474 | qtl: application/x-quicktime-media-link 475 | qtvr: video/quicktime 476 | qwd: application/vnd.Quark.QuarkXPress 477 | qwt: application/vnd.Quark.QuarkXPress 478 | qxb: application/vnd.Quark.QuarkXPress 479 | qxd: application/vnd.Quark.QuarkXPress 480 | qxl: application/vnd.Quark.QuarkXPress 481 | qxt: application/vnd.Quark.QuarkXPress 482 | ra: audio/vnd.rn-realaudio 483 | raf: image/x-fuji-raf 484 | ram: audio/x-pn-realaudio 485 | rar: application/x-rar 486 | ras: image/x-cmu-raster 487 | raw: image/x-panasonic-raw 488 | rax: audio/vnd.rn-realaudio 489 | rb: application/x-ruby 490 | rcprofile: application/vnd.ipunplugged.rcprofile 491 | rct: application/prs.nprend 492 | rdf: text/rdf 493 | rdfs: text/rdf 494 | rdz: application/vnd.data-vision.rdz 495 | rej: application/x-reject 496 | req: application/vnd.nervana 497 | request: application/vnd.nervana 498 | rgb: image/x-rgb 499 | rhtml: text/rhtml 500 | rle: image/rle 501 | rm: application/vnd.rn-realmedia 502 | rmj: application/vnd.rn-realmedia 503 | rmm: application/vnd.rn-realmedia 504 | rms: application/vnd.rn-realmedia 505 | rmvb: application/vnd.rn-realmedia 506 | rmx: application/vnd.rn-realmedia 507 | rnd: application/prs.nprend 508 | roff: text/troff 509 | rp: image/vnd.rn-realpix 510 | rpm: application/x-rpm 511 | rpss: application/vnd.nokia.radio-presets 512 | rpst: application/vnd.nokia.radio-preset 513 | rss: application/rss+xml 514 | rst: text/prs.fallenstein.rst 515 | rt: text/vnd.rn-realtext 516 | rtf: application/rtf 517 | rtx: text/richtext 518 | rxml: application/x-ruby 519 | rv: video/vnd.rn-realvideo 520 | rvx: video/vnd.rn-realvideo 521 | s11: video/vnd.sealed.mpeg1 522 | s14: video/vnd.sealed.mpeg4 523 | s1a: application/vnd.sealedmedia.softseal.pdf 524 | s1e: application/vnd.sealed.xls 525 | s1g: image/vnd.sealedmedia.softseal.gif 526 | s1h: application/vnd.sealedmedia.softseal.html 527 | s1j: image/vnd.sealedmedia.softseal.jpg 528 | s1m: audio/vnd.sealedmedia.softseal.mpeg 529 | s1n: image/vnd.sealed.png 530 | s1p: application/vnd.sealed.ppt 531 | s1q: video/vnd.sealedmedia.softseal.mov 532 | s1w: application/vnd.sealed.doc 533 | s3m: audio/x-s3m 534 | saf: application/vnd.yamaha.smaf-audio 535 | sam: application/x-amipro 536 | sami: application/x-sami 537 | sc: application/vnd.ibm.secure-container 538 | scm: text/x-scheme 539 | sda: application/vnd.stardivision.draw 540 | sdc: application/vnd.stardivision.calc 541 | sdd: application/vnd.stardivision.impress 542 | sdf: application/vnd.Kinar 543 | sdo: application/vnd.sealed.doc 544 | sdoc: application/vnd.sealed.doc 545 | sdp: application/vnd.stardivision.impress 546 | sds: application/vnd.stardivision.chart 547 | sdw: application/vnd.stardivision.writer 548 | see: application/vnd.seemail 549 | sem: application/vnd.sealed.eml 550 | seml: application/vnd.sealed.eml 551 | ser: application/x-java-serialized-object 552 | sgf: application/x-go-sgf 553 | sgi: image/vnd.sealedmedia.softseal.gif 554 | sgif: image/vnd.sealedmedia.softseal.gif 555 | sgl: application/vnd.stardivision.writer 556 | sgm: text/sgml 557 | sgml: text/sgml 558 | sh: application/x-shellscript 559 | shar: application/x-shar 560 | shn: application/x-shorten 561 | shtml: text/html 562 | si: text/vnd.wap.si 563 | siag: application/x-siag 564 | sic: application/vnd.wap.sic 565 | sid: audio/prs.sid 566 | sig: application/pgp-signature 567 | sik: application/x-trash 568 | silo: model/mesh 569 | sis: application/vnd.symbian.install 570 | sisx: x-epoc/x-sisx-app 571 | sit: application/stuffit 572 | siv: application/sieve 573 | sjp: image/vnd.sealedmedia.softseal.jpg 574 | sjpg: image/vnd.sealedmedia.softseal.jpg 575 | skr: application/pgp-keys 576 | sl: text/vnd.wap.sl 577 | slc: application/vnd.wap.slc 578 | slk: text/spreadsheet 579 | smc: application/x-snes-rom 580 | smd: application/vnd.stardivision.mail 581 | smf: application/vnd.stardivision.math 582 | smh: application/vnd.sealed.mht 583 | smht: application/vnd.sealed.mht 584 | smi: application/smil 585 | smil: application/smil 586 | sml: application/smil 587 | smo: video/vnd.sealedmedia.softseal.mov 588 | smov: video/vnd.sealedmedia.softseal.mov 589 | smp: audio/vnd.sealedmedia.softseal.mpeg 590 | smp3: audio/vnd.sealedmedia.softseal.mpeg 591 | smpg: video/vnd.sealed.mpeg4 592 | sms: application/vnd.3gpp.sms 593 | smv: audio/SMV 594 | snd: audio/basic 595 | so: application/x-sharedlib 596 | soc: application/sgml-open-catalog 597 | spd: application/vnd.sealedmedia.softseal.pdf 598 | spdf: application/vnd.sealedmedia.softseal.pdf 599 | spec: text/x-rpm-spec 600 | spf: application/vnd.yamaha.smaf-phrase 601 | spl: application/x-shockwave-flash 602 | spn: image/vnd.sealed.png 603 | spng: image/vnd.sealed.png 604 | spp: application/vnd.sealed.ppt 605 | sppt: application/vnd.sealed.ppt 606 | spx: audio/x-speex 607 | sql: text/x-sql 608 | sr2: image/x-sony-sr2 609 | src: application/x-wais-source 610 | srf: image/x-sony-srf 611 | srt: application/x-subrip 612 | ssa: text/x-ssa 613 | ssw: video/vnd.sealed.swf 614 | sswf: video/vnd.sealed.swf 615 | stc: application/vnd.sun.xml.calc.template 616 | std: application/vnd.sun.xml.draw.template 617 | sti: application/vnd.sun.xml.impress.template 618 | stk: application/hyperstudio 619 | stm: application/vnd.sealedmedia.softseal.html 620 | stml: application/vnd.sealedmedia.softseal.html 621 | stw: application/vnd.sun.xml.writer.template 622 | sty: text/x-tex 623 | sub: text/x-mpsub 624 | sun: image/x-sun-raster 625 | sus: application/vnd.sus-calendar 626 | susp: application/vnd.sus-calendar 627 | sv4cpio: application/x-sv4cpio 628 | sv4crc: application/x-sv4crc 629 | svg: image/svg+xml 630 | svgz: image/svg+xml-compressed 631 | swf: application/x-shockwave-flash 632 | sxc: application/vnd.sun.xml.calc 633 | sxd: application/vnd.sun.xml.draw 634 | sxg: application/vnd.sun.xml.writer.global 635 | sxl: application/vnd.sealed.xls 636 | sxls: application/vnd.sealed.xls 637 | sxm: application/vnd.sun.xml.math 638 | sxw: application/vnd.sun.xml.writer 639 | sylk: text/spreadsheet 640 | t: text/troff 641 | t2t: text/x-txt2tags 642 | tar: application/x-tar 643 | tbz: application/x-bzip-compressed-tar 644 | tbz2: application/x-bzip-compressed-tar 645 | tcl: text/x-tcl 646 | tex: text/x-tex 647 | texi: text/x-texinfo 648 | texinfo: text/x-texinfo 649 | tga: image/x-tga 650 | tgz: application/x-compressed-tar 651 | theme: application/x-theme 652 | tif: image/tiff 653 | tiff: image/tiff 654 | tk: text/x-tcl 655 | tnef: application/vnd.ms-tnef 656 | tnf: application/vnd.ms-tnef 657 | torrent: application/x-bittorrent 658 | tpic: image/x-tga 659 | tr: text/troff 660 | troff: text/troff 661 | ts: application/x-linguist 662 | tsv: text/tab-separated-values 663 | tta: audio/x-tta 664 | ttc: application/x-font-ttf 665 | ttf: application/x-font-ttf 666 | txd: application/vnd.genomatix.tuxedo 667 | txt: text/plain 668 | tzo: application/x-tzo 669 | ufraw: application/x-ufraw 670 | ui: application/x-designer 671 | uil: text/x-uil 672 | ult: audio/x-mod 673 | uni: audio/x-mod 674 | upa: application/vnd.hbci 675 | url: text/x-uri 676 | ustar: application/x-ustar 677 | vala: text/x-vala 678 | vbk: audio/vnd.nortel.vbk 679 | vcf: text/x-vcard 680 | vcs: text/x-vcalendar 681 | vct: text/directory 682 | vda: image/x-tga 683 | vhd: text/x-vhdl 684 | vhdl: text/x-vhdl 685 | vis: application/vnd.visionary 686 | viv: video/vivo 687 | vivo: video/vivo 688 | vlc: audio/x-mpegurl 689 | vob: video/mpeg 690 | voc: audio/x-voc 691 | vor: application/vnd.stardivision.writer 692 | vrml: x-world/x-vrml 693 | vsc: application/vnd.vidsoft.vidconference 694 | vsd: application/vnd.visio 695 | vss: application/vnd.visio 696 | vst: application/vnd.visio 697 | vsw: application/vnd.visio 698 | wav: audio/x-wav 699 | wax: audio/x-ms-asx 700 | wb1: application/x-quattropro 701 | wb2: application/x-quattropro 702 | wb3: application/x-quattropro 703 | wbmp: image/vnd.wap.wbmp 704 | wbs: application/vnd.criticaltools.wbs+xml 705 | wbxml: application/vnd.wap.wbxml 706 | wif: application/watcherinfo+xml 707 | wk1: application/vnd.lotus-1-2-3 708 | wk3: application/vnd.lotus-1-2-3 709 | wk4: application/vnd.lotus-1-2-3 710 | wks: application/vnd.lotus-1-2-3 711 | wm: video/x-ms-wm 712 | wma: audio/x-ms-wma 713 | wmd: application/x-ms-wmd 714 | wmf: image/x-wmf 715 | wml: text/vnd.wap.wml 716 | wmlc: application/vnd.wap.wmlc 717 | wmls: text/vnd.wap.wmlscript 718 | wmlsc: application/vnd.wap.wmlscriptc 719 | wmv: video/x-ms-wmv 720 | wmx: audio/x-ms-asx 721 | wmz: application/x-ms-wmz 722 | wp: application/vnd.wordperfect 723 | wp4: application/vnd.wordperfect 724 | wp5: application/vnd.wordperfect 725 | wp6: application/vnd.wordperfect 726 | wpd: application/vnd.wordperfect 727 | wpg: application/x-wpg 728 | wpl: application/vnd.ms-wpl 729 | wpp: application/vnd.wordperfect 730 | wqd: application/vnd.wqd 731 | wri: application/x-mswrite 732 | wrl: x-world/x-vrml 733 | wtb: application/vnd.webturbo 734 | wv: audio/x-wavpack 735 | wvc: audio/x-wavpack-correction 736 | wvp: audio/x-wavpack 737 | wvx: audio/x-ms-asx 738 | x_b: model/vnd.parasolid.transmit.binary 739 | x_t: model/vnd.parasolid.transmit.text 740 | x3f: image/x-sigma-x3f 741 | xac: application/x-gnucash 742 | xbel: application/x-xbel 743 | xbl: application/xml 744 | xbm: image/x-xbitmap 745 | xcf: image/x-xcf 746 | xfdf: application/vnd.adobe.xfdf 747 | xhtml: application/xhtml+xml 748 | xi: audio/x-xi 749 | xla: application/vnd.ms-excel 750 | xlc: application/vnd.ms-excel 751 | xld: application/vnd.ms-excel 752 | xlf: application/x-xliff 753 | xliff: application/x-xliff 754 | xll: application/vnd.ms-excel 755 | xlm: application/vnd.ms-excel 756 | xls: application/vnd.ms-excel 757 | xlsx: application/vnd.ms-excel 758 | xlt: application/vnd.ms-excel 759 | xlw: application/vnd.ms-excel 760 | xm: audio/x-xm 761 | xmi: text/x-xmi 762 | xml: text/xml 763 | xmt_bin: model/vnd.parasolid.transmit.binary 764 | xmt_txt: model/vnd.parasolid.transmit.text 765 | xpm: image/x-xpixmap 766 | xps: application/vnd.ms-xpsdocument 767 | xsl: application/xml 768 | xslfo: text/x-xslfo 769 | xslt: application/xml 770 | xspf: application/xspf+xml 771 | xul: application/vnd.mozilla.xul+xml 772 | xwd: image/x-xwindowdump 773 | xyz: x-chemical/x-xyz 774 | yaml: text/x-yaml 775 | yml: text/x-yaml 776 | z: application/x-compressed 777 | zabw: application/x-abiword 778 | zip: application/zip 779 | zoo: application/x-zoo 780 | --------------------------------------------------------------------------------