डॉक्स, पीपीटीएक्स आदि के लिए एक सही माइम प्रकार क्या है?


1028

पुराने * .doc दस्तावेजों के लिए यह पर्याप्त था:

header("Content-Type: application/msword");

नए दस्तावेज़ दस्तावेज़ों के लिए मुझे किस प्रकार के माइम का उपयोग करना चाहिए? Pptx और xlsx दस्तावेजों के लिए भी?


10
यदि आप linux का उपयोग करते हैं, तो आप इस कमांड का उपयोग कर सकते हैंfile -bi YOUR_FILE
ajreal

6
@ajreal जो MIME प्रकार प्रदान नहीं करता है। उस कमांड के साथ एक jpg के लिए आउटपुट जैसा दिखेगाJPEG image data, EXIF standard
wmarbut

1
@wmarbut -iध्वज का एक वैकल्पिक नाम है --mime

1
@wmarbut मुझे चूना प्रकार प्रदान करने के लिए लगता है। यह एक jpeg के साथ की कोशिश की और मिल गया: image/jpeg; charset=binaryजहां image/jpegमाइम प्रकार है।
noboks

आप उन्हें यहाँ देख सकते हैं: msdn.microsoft.com/en-us/library/ms775147.aspx
ईब्रम खलील

जवाबों:


2453

यहां HTTP सामग्री स्ट्रीमिंग के लिए सही Microsoft Office MIME प्रकार हैं:

Extension MIME Type
.doc      application/msword
.dot      application/msword

.docx     application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotx     application/vnd.openxmlformats-officedocument.wordprocessingml.template
.docm     application/vnd.ms-word.document.macroEnabled.12
.dotm     application/vnd.ms-word.template.macroEnabled.12

.xls      application/vnd.ms-excel
.xlt      application/vnd.ms-excel
.xla      application/vnd.ms-excel

.xlsx     application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltx     application/vnd.openxmlformats-officedocument.spreadsheetml.template
.xlsm     application/vnd.ms-excel.sheet.macroEnabled.12
.xltm     application/vnd.ms-excel.template.macroEnabled.12
.xlam     application/vnd.ms-excel.addin.macroEnabled.12
.xlsb     application/vnd.ms-excel.sheet.binary.macroEnabled.12

.ppt      application/vnd.ms-powerpoint
.pot      application/vnd.ms-powerpoint
.pps      application/vnd.ms-powerpoint
.ppa      application/vnd.ms-powerpoint

.pptx     application/vnd.openxmlformats-officedocument.presentationml.presentation
.potx     application/vnd.openxmlformats-officedocument.presentationml.template
.ppsx     application/vnd.openxmlformats-officedocument.presentationml.slideshow
.ppam     application/vnd.ms-powerpoint.addin.macroEnabled.12
.pptm     application/vnd.ms-powerpoint.presentation.macroEnabled.12
.potm     application/vnd.ms-powerpoint.template.macroEnabled.12
.ppsm     application/vnd.ms-powerpoint.slideshow.macroEnabled.12

.mdb      application/vnd.ms-access

अधिक जानकारी के लिए इस TechNet लेख और इस ब्लॉग पोस्ट को देखें


10
यह शायद थोड़ा पुराना है, मैं .xlsx के लिए आवेदन / vnd.ms-excel का उपयोग करता हूं
Ajouve

18
इस MSDN ब्लॉग प्रविष्टि में 2007 और पूर्व-2007 फ़ाइल प्रारूप MIME प्रकार दोनों हैं।
जेफ इवांस

12
अनुप्रयोग / vnd.ms-excel विशेष रूप से .xls फ़ाइलों के लिए है। इसके साथ काम करने की क्षमता .xlsx उपयोग में क्लाइंट सॉफ़्टवेयर पर निर्भर करती है।
आर्मंड

5
यदि एक दिन उदाहरण के साथ एक ट्यूटोरियल होता है, तो कैसे जवाब देना है, मैं इस जवाब को वहां रखूंगा।
xenteros

7
चूंकि किसी और ने यह नहीं कहा है: "आवेदन / vnd.openxmlformats-officedocument.wordprocessingml.document" - क्या यह वास्तव में आवश्यक था ?!
निकोलस पीटरसन

23

वैकल्पिक रूप से, यदि आप .Net v4.5 या इसके बाद के संस्करण में काम कर रहे हैं, तो MIME प्रकार प्राप्त करने के लिए System.Web.MimeMapping.GetMimeMapping (yourFileName) का उपयोग करके प्रयास करें - हार्ड-कोडिंग स्ट्रिंग्स की तुलना में बहुत बेहतर


1
खैर, यह है कि ज्यादातर क्षुधा फ़ाइल प्रकारों का सिर्फ एक मुट्ठी भर के साथ सौदा करने की उम्मीद को देखते हुए मुझे नहीं लगता कि एपीआई का उपयोग है बहुत हार्ड-कोड तार की तुलना में बेहतर। यह ऐसा नहीं है कि MIME वैसे भी जल्द ही बदल जाएगा। मेमोरी में डेटा के एक ट्रक को लोड करने की आवश्यकता नहीं है जिसे आप कभी भी उपयोग नहीं करेंगे।
सोमा म्बादेवी

1
कोई "सही" उत्तर नहीं है - व्यक्तिगत रूप से मैं अपने कोड में हार्ड-कोडिंग "मैजिक स्ट्रिंग्स" से बचना पसंद करता हूं और ईमानदार होना चाहता हूं कि मैं हर बार उन्हें देखने के लिए बहुत आलसी हूं, जब एक सरल विधि होती है जो इसे अच्छी तरह से लपेटता है मुझे।
पीट

8

यहाँ (लगभग) JSON प्रारूप में फ़ाइल एक्सटेंशन का MIME है। बस उदाहरण के लिए: MIME ["ppt"], MIME ["docx"], आदि

{"x3d": "application/vnd.hzn-3d-crossword", "3gp": "video/3gpp", "3g2": "video/3gpp2", "mseq": "application/vnd.mseq", "pwn": "application/vnd.3m.post-it-notes", "plb": "application/vnd.3gpp.pic-bw-large", "psb": "application/vnd.3gpp.pic-bw-small", "pvb": "application/vnd.3gpp.pic-bw-var", "tcap": "application/vnd.3gpp2.tcap", "7z": "application/x-7z-compressed", "abw": "application/x-abiword", "ace": "application/x-ace-compressed", "acc": "application/vnd.americandynamics.acc", "acu": "application/vnd.acucobol", "atc": "application/vnd.acucorp", "adp": "audio/adpcm", "aab": "application/x-authorware-bin", "aam": "application/x-authorware-map", "aas": "application/x-authorware-seg", "air": "application/vnd.adobe.air-application-installer-package+zip", "swf": "application/x-shockwave-flash", "fxp": "application/vnd.adobe.fxp", "pdf": "application/pdf", "ppd": "application/vnd.cups-ppd", "dir": "application/x-director", "xdp": "application/vnd.adobe.xdp+xml", "xfdf": "application/vnd.adobe.xfdf", "aac": "audio/x-aac", "ahead": "application/vnd.ahead.space", "azf": "application/vnd.airzip.filesecure.azf", "azs": "application/vnd.airzip.filesecure.azs", "azw": "application/vnd.amazon.ebook", "ami": "application/vnd.amiga.ami", "N/A": "application/andrew-inset", "apk": "application/vnd.android.package-archive", "cii": "application/vnd.anser-web-certificate-issue-initiation", "fti": "application/vnd.anser-web-funds-transfer-initiation", "atx": "application/vnd.antix.game-component", "dmg": "application/x-apple-diskimage", "mpkg": "application/vnd.apple.installer+xml", "aw": "application/applixware", "mp3": "audio/mpeg", "les": "application/vnd.hhe.lesson-player", "swi": "application/vnd.aristanetworks.swi", "s": "text/x-asm", "atomcat": "application/atomcat+xml", "atomsvc": "application/atomsvc+xml", "atom, .xml": "application/atom+xml", "ac": "application/pkix-attr-cert", "aif": "audio/x-aiff", "avi": "video/x-msvideo", "aep": "application/vnd.audiograph", "dxf": "image/vnd.dxf", "dwf": "model/vnd.dwf", "par": "text/plain-bas", "bcpio": "application/x-bcpio", "bin": "application/octet-stream", "bmp": "image/bmp", "torrent": "application/x-bittorrent", "cod": "application/vnd.rim.cod", "mpm": "application/vnd.blueice.multipass", "bmi": "application/vnd.bmi", "sh": "application/x-sh", "btif": "image/prs.btif", "rep": "application/vnd.businessobjects", "bz": "application/x-bzip", "bz2": "application/x-bzip2", "csh": "application/x-csh", "c": "text/x-c", "cdxml": "application/vnd.chemdraw+xml", "css": "text/css", "cdx": "chemical/x-cdx", "cml": "chemical/x-cml", "csml": "chemical/x-csml", "cdbcmsg": "application/vnd.contact.cmsg", "cla": "application/vnd.claymore", "c4g": "application/vnd.clonk.c4group", "sub": "image/vnd.dvb.subtitle", "cdmia": "application/cdmi-capability", "cdmic": "application/cdmi-container", "cdmid": "application/cdmi-domain", "cdmio": "application/cdmi-object", "cdmiq": "application/cdmi-queue", "c11amc": "application/vnd.cluetrust.cartomobile-config", "c11amz": "application/vnd.cluetrust.cartomobile-config-pkg", "ras": "image/x-cmu-raster", "dae": "model/vnd.collada+xml", "csv": "text/csv", "cpt": "application/mac-compactpro", "wmlc": "application/vnd.wap.wmlc", "cgm": "image/cgm", "ice": "x-conference/x-cooltalk", "cmx": "image/x-cmx", "xar": "application/vnd.xara", "cmc": "application/vnd.cosmocaller", "cpio": "application/x-cpio", "clkx": "application/vnd.crick.clicker", "clkk": "application/vnd.crick.clicker.keyboard", "clkp": "application/vnd.crick.clicker.palette", "clkt": "application/vnd.crick.clicker.template", "clkw": "application/vnd.crick.clicker.wordbank", "wbs": "application/vnd.criticaltools.wbs+xml", "cryptonote": "application/vnd.rig.cryptonote", "cif": "chemical/x-cif", "cmdf": "chemical/x-cmdf", "cu": "application/cu-seeme", "cww": "application/prs.cww", "curl": "text/vnd.curl", "dcurl": "text/vnd.curl.dcurl", "mcurl": "text/vnd.curl.mcurl", "scurl": "text/vnd.curl.scurl", "car": "application/vnd.curl.car", "pcurl": "application/vnd.curl.pcurl", "cmp": "application/vnd.yellowriver-custom-menu", "dssc": "application/dssc+der", "xdssc": "application/dssc+xml", "deb": "application/x-debian-package", "uva": "audio/vnd.dece.audio", "uvi": "image/vnd.dece.graphic", "uvh": "video/vnd.dece.hd", "uvm": "video/vnd.dece.mobile", "uvu": "video/vnd.uvvu.mp4", "uvp": "video/vnd.dece.pd", "uvs": "video/vnd.dece.sd", "uvv": "video/vnd.dece.video", "dvi": "application/x-dvi", "seed": "application/vnd.fdsn.seed", "dtb": "application/x-dtbook+xml", "res": "application/x-dtbresource+xml", "ait": "application/vnd.dvb.ait", "svc": "application/vnd.dvb.service", "eol": "audio/vnd.digital-winds", "djvu": "image/vnd.djvu", "dtd": "application/xml-dtd", "mlp": "application/vnd.dolby.mlp", "wad": "application/x-doom", "dpg": "application/vnd.dpgraph", "dra": "audio/vnd.dra", "dfac": "application/vnd.dreamfactory", "dts": "audio/vnd.dts", "dtshd": "audio/vnd.dts.hd", "dwg": "image/vnd.dwg", "geo": "application/vnd.dynageo", "es": "application/ecmascript", "mag": "application/vnd.ecowin.chart", "mmr": "image/vnd.fujixerox.edmics-mmr", "rlc": "image/vnd.fujixerox.edmics-rlc", "exi": "application/exi", "mgz": "application/vnd.proteus.magazine", "epub": "application/epub+zip", "eml": "message/rfc822", "nml": "application/vnd.enliven", "xpr": "application/vnd.is-xpr", "xif": "image/vnd.xiff", "xfdl": "application/vnd.xfdl", "emma": "application/emma+xml", "ez2": "application/vnd.ezpix-album", "ez3": "application/vnd.ezpix-package", "fst": "image/vnd.fst", "fvt": "video/vnd.fvt", "fbs": "image/vnd.fastbidsheet", "fe_launch": "application/vnd.denovo.fcselayout-link", "f4v": "video/x-f4v", "flv": "video/x-flv", "fpx": "image/vnd.fpx", "npx": "image/vnd.net-fpx", "flx": "text/vnd.fmi.flexstor", "fli": "video/x-fli", "ftc": "application/vnd.fluxtime.clip", "fdf": "application/vnd.fdf", "f": "text/x-fortran", "mif": "application/vnd.mif", "fm": "application/vnd.framemaker", "fh": "image/x-freehand", "fsc": "application/vnd.fsc.weblaunch", "fnc": "application/vnd.frogans.fnc", "ltf": "application/vnd.frogans.ltf", "ddd": "application/vnd.fujixerox.ddd", "xdw": "application/vnd.fujixerox.docuworks", "xbd": "application/vnd.fujixerox.docuworks.binder", "oas": "application/vnd.fujitsu.oasys", "oa2": "application/vnd.fujitsu.oasys2", "oa3": "application/vnd.fujitsu.oasys3", "fg5": "application/vnd.fujitsu.oasysgp", "bh2": "application/vnd.fujitsu.oasysprs", "spl": "application/x-futuresplash", "fzs": "application/vnd.fuzzysheet", "g3": "image/g3fax", "gmx": "application/vnd.gmx", "gtw": "model/vnd.gtw", "txd": "application/vnd.genomatix.tuxedo", "ggb": "application/vnd.geogebra.file", "ggt": "application/vnd.geogebra.tool", "gdl": "model/vnd.gdl", "gex": "application/vnd.geometry-explorer", "gxt": "application/vnd.geonext", "g2w": "application/vnd.geoplan", "g3w": "application/vnd.geospace", "gsf": "application/x-font-ghostscript", "bdf": "application/x-font-bdf", "gtar": "application/x-gtar", "texinfo": "application/x-texinfo", "gnumeric": "application/x-gnumeric", "kml": "application/vnd.google-earth.kml+xml", "kmz": "application/vnd.google-earth.kmz", "gqf": "application/vnd.grafeq", "gif": "image/gif", "gv": "text/vnd.graphviz", "gac": "application/vnd.groove-account", "ghf": "application/vnd.groove-help", "gim": "application/vnd.groove-identity-message", "grv": "application/vnd.groove-injector", "gtm": "application/vnd.groove-tool-message", "tpl": "application/vnd.groove-tool-template", "vcg": "application/vnd.groove-vcard", "h261": "video/h261", "h263": "video/h263", "h264": "video/h264", "hpid": "application/vnd.hp-hpid", "hps": "application/vnd.hp-hps", "hdf": "application/x-hdf", "rip": "audio/vnd.rip", "hbci": "application/vnd.hbci", "jlt": "application/vnd.hp-jlyt", "pcl": "application/vnd.hp-pcl", "hpgl": "application/vnd.hp-hpgl", "hvs": "application/vnd.yamaha.hv-script", "hvd": "application/vnd.yamaha.hv-dic", "hvp": "application/vnd.yamaha.hv-voice", "sfd-hdstx": "application/vnd.hydrostatix.sof-data", "stk": "application/hyperstudio", "hal": "application/vnd.hal+xml", "html": "text/html", "irm": "application/vnd.ibm.rights-management", "sc": "application/vnd.ibm.secure-container", "ics": "text/calendar", "icc": "application/vnd.iccprofile", "ico": "image/x-icon", "igl": "application/vnd.igloader", "ief": "image/ief", "ivp": "application/vnd.immervision-ivp", "ivu": "application/vnd.immervision-ivu", "rif": "application/reginfo+xml", "3dml": "text/vnd.in3d.3dml", "spot": "text/vnd.in3d.spot", "igs": "model/iges", "i2g": "application/vnd.intergeo", "cdy": "application/vnd.cinderella", "xpw": "application/vnd.intercon.formnet", "fcs": "application/vnd.isac.fcs", "ipfix": "application/ipfix", "cer": "application/pkix-cert", "pki": "application/pkixcmp", "crl": "application/pkix-crl", "pkipath": "application/pkix-pkipath", "igm": "application/vnd.insors.igm", "rcprofile": "application/vnd.ipunplugged.rcprofile", "irp": "application/vnd.irepository.package+xml", "jad": "text/vnd.sun.j2me.app-descriptor", "jar": "application/java-archive", "class": "application/java-vm", "jnlp": "application/x-java-jnlp-file", "ser": "application/java-serialized-object", "java": "text/x-java-source,java", "js": "application/javascript", "json": "application/json", "joda": "application/vnd.joost.joda-archive", "jpm": "video/jpm", "jpeg, .jpg": "image/x-citrix-jpeg", "pjpeg": "image/pjpeg", "jpgv": "video/jpeg", "ktz": "application/vnd.kahootz", "mmd": "application/vnd.chipnuts.karaoke-mmd", "karbon": "application/vnd.kde.karbon", "chrt": "application/vnd.kde.kchart", "kfo": "application/vnd.kde.kformula", "flw": "application/vnd.kde.kivio", "kon": "application/vnd.kde.kontour", "kpr": "application/vnd.kde.kpresenter", "ksp": "application/vnd.kde.kspread", "kwd": "application/vnd.kde.kword", "htke": "application/vnd.kenameaapp", "kia": "application/vnd.kidspiration", "kne": "application/vnd.kinar", "sse": "application/vnd.kodak-descriptor", "lasxml": "application/vnd.las.las+xml", "latex": "application/x-latex", "lbd": "application/vnd.llamagraphics.life-balance.desktop", "lbe": "application/vnd.llamagraphics.life-balance.exchange+xml", "jam": "application/vnd.jam", "123": "application/vnd.lotus-1-2-3", "apr": "application/vnd.lotus-approach", "pre": "application/vnd.lotus-freelance", "nsf": "application/vnd.lotus-notes", "org": "application/vnd.lotus-organizer", "scm": "application/vnd.lotus-screencam", "lwp": "application/vnd.lotus-wordpro", "lvp": "audio/vnd.lucent.voice", "m3u": "audio/x-mpegurl", "m4v": "video/x-m4v", "hqx": "application/mac-binhex40", "portpkg": "application/vnd.macports.portpkg", "mgp": "application/vnd.osgeo.mapguide.package", "mrc": "application/marc", "mrcx": "application/marcxml+xml", "mxf": "application/mxf", "nbp": "application/vnd.wolfram.player", "ma": "application/mathematica", "mathml": "application/mathml+xml", "mbox": "application/mbox", "mc1": "application/vnd.medcalcdata", "mscml": "application/mediaservercontrol+xml", "cdkey": "application/vnd.mediastation.cdkey", "mwf": "application/vnd.mfer", "mfm": "application/vnd.mfmp", "msh": "model/mesh", "mads": "application/mads+xml", "mets": "application/mets+xml", "mods": "application/mods+xml", "meta4": "application/metalink4+xml", "mcd": "application/vnd.mcd", "flo": "application/vnd.micrografx.flo", "igx": "application/vnd.micrografx.igx", "es3": "application/vnd.eszigno3+xml", "mdb": "application/x-msaccess", "asf": "video/x-ms-asf", "exe": "application/x-msdownload", "cil": "application/vnd.ms-artgalry", "cab": "application/vnd.ms-cab-compressed", "ims": "application/vnd.ms-ims", "application": "application/x-ms-application", "clp": "application/x-msclip", "mdi": "image/vnd.ms-modi", "eot": "application/vnd.ms-fontobject", "xls": "application/vnd.ms-excel", "xlam": "application/vnd.ms-excel.addin.macroenabled.12", "xlsb": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "xltm": "application/vnd.ms-excel.template.macroenabled.12", "xlsm": "application/vnd.ms-excel.sheet.macroenabled.12", "chm": "application/vnd.ms-htmlhelp", "crd": "application/x-mscardfile", "lrm": "application/vnd.ms-lrm", "mvb": "application/x-msmediaview", "mny": "application/x-msmoney", "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "sldx": "application/vnd.openxmlformats-officedocument.presentationml.slide", "ppsx": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "potx": "application/vnd.openxmlformats-officedocument.presentationml.template", "xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "xltx": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "dotx": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "obd": "application/x-msbinder", "thmx": "application/vnd.ms-officetheme", "onetoc": "application/onenote", "pya": "audio/vnd.ms-playready.media.pya", "pyv": "video/vnd.ms-playready.media.pyv", "ppt": "application/vnd.ms-powerpoint", "ppam": "application/vnd.ms-powerpoint.addin.macroenabled.12", "sldm": "application/vnd.ms-powerpoint.slide.macroenabled.12", "pptm": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "ppsm": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "potm": "application/vnd.ms-powerpoint.template.macroenabled.12", "mpp": "application/vnd.ms-project", "pub": "application/x-mspublisher", "scd": "application/x-msschedule", "xap": "application/x-silverlight-app", "stl": "application/vnd.ms-pki.stl", "cat": "application/vnd.ms-pki.seccat", "vsd": "application/vnd.visio", "vsdx": "application/vnd.visio2013", "wm": "video/x-ms-wm", "wma": "audio/x-ms-wma", "wax": "audio/x-ms-wax", "wmx": "video/x-ms-wmx", "wmd": "application/x-ms-wmd", "wpl": "application/vnd.ms-wpl", "wmz": "application/x-ms-wmz", "wmv": "video/x-ms-wmv", "wvx": "video/x-ms-wvx", "wmf": "application/x-msmetafile", "trm": "application/x-msterminal", "doc": "application/msword", "docm": "application/vnd.ms-word.document.macroenabled.12", "dotm": "application/vnd.ms-word.template.macroenabled.12", "wri": "application/x-mswrite", "wps": "application/vnd.ms-works", "xbap": "application/x-ms-xbap", "xps": "application/vnd.ms-xpsdocument", "mid": "audio/midi", "mpy": "application/vnd.ibm.minipay", "afp": "application/vnd.ibm.modcap", "rms": "application/vnd.jcp.javame.midlet-rms", "tmo": "application/vnd.tmobile-livetv", "prc": "application/x-mobipocket-ebook", "mbk": "application/vnd.mobius.mbk", "dis": "application/vnd.mobius.dis", "plc": "application/vnd.mobius.plc", "mqy": "application/vnd.mobius.mqy", "msl": "application/vnd.mobius.msl", "txf": "application/vnd.mobius.txf", "daf": "application/vnd.mobius.daf", "fly": "text/vnd.fly", "mpc": "application/vnd.mophun.certificate", "mpn": "application/vnd.mophun.application", "mj2": "video/mj2", "mpga": "audio/mpeg", "mxu": "video/vnd.mpegurl", "mpeg": "video/mpeg", "m21": "application/mp21", "mp4a": "audio/mp4", "mp4": "application/mp4", "m3u8": "application/vnd.apple.mpegurl", "mus": "application/vnd.musician", "msty": "application/vnd.muvee.style", "mxml": "application/xv+xml", "ngdat": "application/vnd.nokia.n-gage.data", "n-gage": "application/vnd.nokia.n-gage.symbian.install", "ncx": "application/x-dtbncx+xml", "nc": "application/x-netcdf", "nlu": "application/vnd.neurolanguage.nlu", "dna": "application/vnd.dna", "nnd": "application/vnd.noblenet-directory", "nns": "application/vnd.noblenet-sealer", "nnw": "application/vnd.noblenet-web", "rpst": "application/vnd.nokia.radio-preset", "rpss": "application/vnd.nokia.radio-presets", "n3": "text/n3", "edm": "application/vnd.novadigm.edm", "edx": "application/vnd.novadigm.edx", "ext": "application/vnd.novadigm.ext", "gph": "application/vnd.flographit", "ecelp4800": "audio/vnd.nuera.ecelp4800", "ecelp7470": "audio/vnd.nuera.ecelp7470", "ecelp9600": "audio/vnd.nuera.ecelp9600", "oda": "application/oda", "ogx": "application/ogg", "oga": "audio/ogg", "ogv": "video/ogg", "dd2": "application/vnd.oma.dd2+xml", "oth": "application/vnd.oasis.opendocument.text-web", "opf": "application/oebps-package+xml", "qbo": "application/vnd.intu.qbo", "oxt": "application/vnd.openofficeorg.extension", "osf": "application/vnd.yamaha.openscoreformat", "weba": "audio/webm", "webm": "video/webm", "odc": "application/vnd.oasis.opendocument.chart", "otc": "application/vnd.oasis.opendocument.chart-template", "odb": "application/vnd.oasis.opendocument.database", "odf": "application/vnd.oasis.opendocument.formula", "odft": "application/vnd.oasis.opendocument.formula-template", "odg": "application/vnd.oasis.opendocument.graphics", "otg": "application/vnd.oasis.opendocument.graphics-template", "odi": "application/vnd.oasis.opendocument.image", "oti": "application/vnd.oasis.opendocument.image-template", "odp": "application/vnd.oasis.opendocument.presentation", "otp": "application/vnd.oasis.opendocument.presentation-template", "ods": "application/vnd.oasis.opendocument.spreadsheet", "ots": "application/vnd.oasis.opendocument.spreadsheet-template", "odt": "application/vnd.oasis.opendocument.text", "odm": "application/vnd.oasis.opendocument.text-master", "ott": "application/vnd.oasis.opendocument.text-template", "ktx": "image/ktx", "sxc": "application/vnd.sun.xml.calc", "stc": "application/vnd.sun.xml.calc.template", "sxd": "application/vnd.sun.xml.draw", "std": "application/vnd.sun.xml.draw.template", "sxi": "application/vnd.sun.xml.impress", "sti": "application/vnd.sun.xml.impress.template", "sxm": "application/vnd.sun.xml.math", "sxw": "application/vnd.sun.xml.writer", "sxg": "application/vnd.sun.xml.writer.global", "stw": "application/vnd.sun.xml.writer.template", "otf": "application/x-font-otf", "osfpvg": "application/vnd.yamaha.openscoreformat.osfpvg+xml", "dp": "application/vnd.osgi.dp", "pdb": "application/vnd.palm", "p": "text/x-pascal", "paw": "application/vnd.pawaafile", "pclxl": "application/vnd.hp-pclxl", "efif": "application/vnd.picsel", "pcx": "image/x-pcx", "psd": "image/vnd.adobe.photoshop", "prf": "application/pics-rules", "pic": "image/x-pict", "chat": "application/x-chat", "p10": "application/pkcs10", "p12": "application/x-pkcs12", "p7m": "application/pkcs7-mime", "p7s": "application/pkcs7-signature", "p7r": "application/x-pkcs7-certreqresp", "p7b": "application/x-pkcs7-certificates", "p8": "application/pkcs8", "plf": "application/vnd.pocketlearn", "pnm": "image/x-portable-anymap", "pbm": "image/x-portable-bitmap", "pcf": "application/x-font-pcf", "pfr": "application/font-tdpfr", "pgn": "application/x-chess-pgn", "pgm": "image/x-portable-graymap", "png": "image/x-png", "ppm": "image/x-portable-pixmap", "pskcxml": "application/pskc+xml", "pml": "application/vnd.ctc-posml", "ai": "application/postscript", "pfa": "application/x-font-type1", "pbd": "application/vnd.powerbuilder6", "pgp": "application/pgp-signature", "box": "application/vnd.previewsystems.box", "ptid": "application/vnd.pvi.ptid1", "pls": "application/pls+xml", "str": "application/vnd.pg.format", "ei6": "application/vnd.pg.osasli", "dsc": "text/prs.lines.tag", "psf": "application/x-font-linux-psf", "qps": "application/vnd.publishare-delta-tree", "wg": "application/vnd.pmi.widget", "qxd": "application/vnd.quark.quarkxpress", "esf": "application/vnd.epson.esf", "msf": "application/vnd.epson.msf", "ssf": "application/vnd.epson.ssf", "qam": "application/vnd.epson.quickanime", "qfx": "application/vnd.intu.qfx", "qt": "video/quicktime", "rar": "application/x-rar-compressed", "ram": "audio/x-pn-realaudio", "rmp": "audio/x-pn-realaudio-plugin", "rsd": "application/rsd+xml", "rm": "application/vnd.rn-realmedia", "bed": "application/vnd.realvnc.bed", "mxl": "application/vnd.recordare.musicxml", "musicxml": "application/vnd.recordare.musicxml+xml", "rnc": "application/relax-ng-compact-syntax", "rdz": "application/vnd.data-vision.rdz", "rdf": "application/rdf+xml", "rp9": "application/vnd.cloanto.rp9", "jisp": "application/vnd.jisp", "rtf": "application/rtf", "rtx": "text/richtext", "link66": "application/vnd.route66.link66+xml", "rss, .xml": "application/rss+xml", "shf": "application/shf+xml", "st": "application/vnd.sailingtracker.track", "svg": "image/svg+xml", "sus": "application/vnd.sus-calendar", "sru": "application/sru+xml", "setpay": "application/set-payment-initiation", "setreg": "application/set-registration-initiation", "sema": "application/vnd.sema", "semd": "application/vnd.semd", "semf": "application/vnd.semf", "see": "application/vnd.seemail", "snf": "application/x-font-snf", "spq": "application/scvp-vp-request", "spp": "application/scvp-vp-response", "scq": "application/scvp-cv-request", "scs": "application/scvp-cv-response", "sdp": "application/sdp", "etx": "text/x-setext", "movie": "video/x-sgi-movie", "ifm": "application/vnd.shana.informed.formdata", "itp": "application/vnd.shana.informed.formtemplate", "iif": "application/vnd.shana.informed.interchange", "ipk": "application/vnd.shana.informed.package", "tfi": "application/thraud+xml", "shar": "application/x-shar", "rgb": "image/x-rgb", "slt": "application/vnd.epson.salt", "aso": "application/vnd.accpac.simply.aso", "imp": "application/vnd.accpac.simply.imp", "twd": "application/vnd.simtech-mindmapper", "csp": "application/vnd.commonspace", "saf": "application/vnd.yamaha.smaf-audio", "mmf": "application/vnd.smaf", "spf": "application/vnd.yamaha.smaf-phrase", "teacher": "application/vnd.smart.teacher", "svd": "application/vnd.svd", "rq": "application/sparql-query", "srx": "application/sparql-results+xml", "gram": "application/srgs", "grxml": "application/srgs+xml", "ssml": "application/ssml+xml", "skp": "application/vnd.koan", "sgml": "text/sgml", "sdc": "application/vnd.stardivision.calc", "sda": "application/vnd.stardivision.draw", "sdd": "application/vnd.stardivision.impress", "smf": "application/vnd.stardivision.math", "sdw": "application/vnd.stardivision.writer", "sgl": "application/vnd.stardivision.writer-global", "sm": "application/vnd.stepmania.stepchart", "sit": "application/x-stuffit", "sitx": "application/x-stuffitx", "sdkm": "application/vnd.solent.sdkm+xml", "xo": "application/vnd.olpc-sugar", "au": "audio/basic", "wqd": "application/vnd.wqd", "sis": "application/vnd.symbian.install", "smi": "application/smil+xml", "xsm": "application/vnd.syncml+xml", "bdm": "application/vnd.syncml.dm+wbxml", "xdm": "application/vnd.syncml.dm+xml", "sv4cpio": "application/x-sv4cpio", "sv4crc": "application/x-sv4crc", "sbml": "application/sbml+xml", "tsv": "text/tab-separated-values", "tiff": "image/tiff", "tao": "application/vnd.tao.intent-module-archive", "tar": "application/x-tar", "tcl": "application/x-tcl", "tex": "application/x-tex", "tfm": "application/x-tex-tfm", "tei": "application/tei+xml", "txt": "text/plain", "dxp": "application/vnd.spotfire.dxp", "sfs": "application/vnd.spotfire.sfs", "tsd": "application/timestamped-data", "tpt": "application/vnd.trid.tpt", "mxs": "application/vnd.triscape.mxs", "t": "text/troff", "tra": "application/vnd.trueapp", "ttf": "application/x-font-ttf", "ttl": "text/turtle", "umj": "application/vnd.umajin", "uoml": "application/vnd.uoml+xml", "unityweb": "application/vnd.unity", "ufd": "application/vnd.ufdl", "uri": "text/uri-list", "utz": "application/vnd.uiq.theme", "ustar": "application/x-ustar", "uu": "text/x-uuencode", "vcs": "text/x-vcalendar", "vcf": "text/x-vcard", "vcd": "application/x-cdlink", "vsf": "application/vnd.vsf", "wrl": "model/vrml", "vcx": "application/vnd.vcx", "mts": "model/vnd.mts", "vtu": "model/vnd.vtu", "vis": "application/vnd.visionary", "viv": "video/vnd.vivo", "ccxml": "application/ccxml+xml,", "vxml": "application/voicexml+xml", "src": "application/x-wais-source", "wbxml": "application/vnd.wap.wbxml", "wbmp": "image/vnd.wap.wbmp", "wav": "audio/x-wav", "davmount": "application/davmount+xml", "woff": "application/x-font-woff", "wspolicy": "application/wspolicy+xml", "webp": "image/webp", "wtb": "application/vnd.webturbo", "wgt": "application/widget", "hlp": "application/winhlp", "wml": "text/vnd.wap.wml", "wmls": "text/vnd.wap.wmlscript", "wmlsc": "application/vnd.wap.wmlscriptc", "wpd": "application/vnd.wordperfect", "stf": "application/vnd.wt.stf", "wsdl": "application/wsdl+xml", "xbm": "image/x-xbitmap", "xpm": "image/x-xpixmap", "xwd": "image/x-xwindowdump", "der": "application/x-x509-ca-cert", "fig": "application/x-xfig", "xhtml": "application/xhtml+xml", "xml": "application/xml", "xdf": "application/xcap-diff+xml", "xenc": "application/xenc+xml", "xer": "application/patch-ops-error+xml", "rl": "application/resource-lists+xml", "rs": "application/rls-services+xml", "rld": "application/resource-lists-diff+xml", "xslt": "application/xslt+xml", "xop": "application/xop+xml", "xpi": "application/x-xpinstall", "xspf": "application/xspf+xml", "xul": "application/vnd.mozilla.xul+xml", "xyz": "chemical/x-xyz", "yaml": "text/yaml", "yang": "application/yang", "yin": "application/yin+xml", "zir": "application/vnd.zul", "zip": "application/zip", "zmm": "application/vnd.handheld-entertainment+xml", "zaz": "application/vnd.zzazz.deck+xml"}

6

यह पोस्ट हेडर के रूप में एक-लाइन विवरण में अपने CONS के साथ विभिन्न प्रोग्रामिंग भाषाओं में MIME प्रकार लाने के विभिन्न तरीकों का पता लगाएगा। इसलिए, उनके अनुसार उपयोग करें और जो आपके लिए काम करता है।

उदाहरण के लिए। जब उपयोगकर्ता या तो .xls, .xlsx या .xlsm दोनों की आपूर्ति कर सकता है, तो नीचे दिए गए कोड विशेष रूप से सहायक होते हैं और आप उनमें से प्रत्येक के लिए कोड परीक्षण विस्तार और MIME- प्रकार की आपूर्ति लिखना नहीं चाहते हैं। सिस्टम को यह काम करने दें।

अजगर ३

अजगर-जादू का उपयोग करना

>>> pip install python-magic
>>> import magic
>>> magic.from_file("Employee.pdf", mime=True)
'application/pdf'

बिल्ट-इन माइमाइप्स मॉड्यूल का उपयोग करना - मैप फाइलनाम को माइमटेप्स मॉड्यूल

>>> import mimetypes
>>> mimetypes.init()
>>> mimetypes.knownfiles
['/etc/mime.types', '/etc/httpd/mime.types', ... ]
>>> mimetypes.suffix_map['.tgz']
'.tar.gz'
>>> mimetypes.encodings_map['.gz']
'gzip'
>>> mimetypes.types_map['.tgz']
'application/x-tar-gz'

जावा A

स्रोत: जावा में फ़ाइल माइम प्रकार पर बाल्डुंग का ब्लॉग

ऑपरेटिंग सिस्टम पर निर्भर

@Test
public void get_JAVA7_mimetype() {
    Path path = new File("Employee.xlsx").toPath();
    String mimeType = Files.probeContentType(path);

    assertEquals(mimeType, "application/vnd.ms-excel");
}

यह MIME प्रकार की जांच करने के लिए FileTypeDetector कार्यान्वयन का उपयोग करेगा और प्रकार को हल करने के लिए प्रत्येक कार्यान्वयन के checkContentType को आमंत्रित करता है। इसलिए, यदि फ़ाइल कार्यान्वयन के लिए जानी जाती है, तो सामग्री प्रकार वापस आ जाता है। हालाँकि, यदि ऐसा नहीं होता है, तो सिस्टम-डिफॉल्ट फ़ाइल प्रकार डिटेक्टर मंगाया जाता है।


इनपुट स्ट्रीम के पहले कुछ वर्णों का उपयोग करके हल करें

@Test
public void getMIMEType_from_Extension(){
    File file = new File("Employee.xlsx");
    String mimeType = URLConnection.guessContentTypeFromName(file.getName());

    assertEquals(mimeType, "application/vnd.ms-excel");
}

MIME प्रकारों की अंतर्निहित तालिका का उपयोग करना

@Test
public void getMIMEType_UsingGetFileNameMap(){
    File file = new File("Employee.xlsx");
    FileNameMap fileNameMap = URLConnection.getFileNameMap();
    String mimeType = fileNameMap.getContentTypeFor(file.getName());

    assertEquals(mimeType, "image/png");
}

यह URLConnection के सभी उदाहरणों द्वारा उपयोग किए गए MIME प्रकारों के मैट्रिक्स को लौटाता है जो तब इनपुट फ़ाइल प्रकार को हल करने के लिए उपयोग किया जाता है। हालाँकि, MIME प्रकार का यह मैट्रिक्स URLConnection के लिए बहुत सीमित है।

डिफ़ॉल्ट रूप से, वर्ग JRE_HOME / lib में सामग्री-types.properties फ़ाइल का उपयोग करता है। हालाँकि, हम content.types.user.table संपत्ति का उपयोग करके उपयोगकर्ता-विशिष्ट तालिका निर्दिष्ट करके इसे बढ़ा सकते हैं:

System.setProperty("content.types.user.table","<path-to-file>");

जावास्क्रिप्ट

स्रोत: FileReader API और मीडियम के प्रकारों को प्राप्त करने के लिए जावास्क्रिप्ट में जादू नंबरों का उपयोग करने पर मध्यम लेख

FileReader API का उपयोग करके प्राप्त किए गए मैजिक नंबर की व्याख्या करें

अंतिम परिणाम कुछ इस तरह दिखता है जब कोई jaScript फिल्मस्ट्रीम पर आधारित माइमाइप को लाने के लिए उपयोग करता है। इस दृष्टिकोण को देखने और समझने के लिए एम्बेडेड jsFiddle खोलें

बोनस : यह अधिकांश MIME प्रकारों के लिए सुलभ है और आप getMimetype फ़ंक्शन में कस्टम माइम प्रकार जोड़ सकते हैं । साथ ही, इसमें MS Office फ़ाइलें Mime प्रकारों के लिए पूर्ण समर्थन है।

FileReader API परिणाम

इस उदाहरण में किसी फ़ाइल के लिए माइम प्रकार की गणना करने के चरण इस प्रकार होंगे:

  1. उपयोगकर्ता एक फ़ाइल का चयन करता है।
  2. स्लाइस विधि का उपयोग करके फ़ाइल के पहले 4 बाइट्स लें।
  3. एक नया FileReader उदाहरण बनाएँ
  4. सरणी बफ़र के रूप में कटा हुआ 4 बाइट्स पढ़ने के लिए FileReader का उपयोग करें।
  5. चूंकि बाइनरी बफर एक द्विआधारी बफर का प्रतिनिधित्व करने के लिए सिर्फ एक सामान्य तरीका है, हमें इस प्रकार एक Uint8Array इस मामले में, एक टाइपडियर बनाने की आवश्यकता है।
  6. अपने हाथों में एक टाइपएड्रे के साथ हम हर बाइट को पुनः प्राप्त कर सकते हैं और इसे हेक्साडेसिमल में बदल सकते हैं (स्टर्लिंग (16) का उपयोग करके)।
  7. अब हमारे पास पहले चार बाइट्स पढ़कर किसी फ़ाइल से मैजिक नंबर प्राप्त करने का एक तरीका है। अंतिम चरण इसे वास्तविक माइम प्रकार में मैप करना है।

ब्राउज़र समर्थन (कुल मिलाकर 95% और सभी आधुनिक ब्राउज़रों में 100% के करीब) : FileReader API

फाइल रीडर एपीआई ब्राउज़र सपोर्ट


4

यदि किसी को C # स्विच स्टेटमेंट में डिर्क वोल्मार का उत्तर चाहिए :

case "doc": return "application/msword";
case "dot": return "application/msword";
case "docx": return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
case "dotx": return "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
case "docm": return "application/vnd.ms-word.document.macroEnabled.12";
case "dotm": return "application/vnd.ms-word.template.macroEnabled.12";
case "xls": return "application/vnd.ms-excel";
case "xlt": return "application/vnd.ms-excel";
case "xla": return "application/vnd.ms-excel";
case "xlsx": return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
case "xltx": return "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
case "xlsm": return "application/vnd.ms-excel.sheet.macroEnabled.12";
case "xltm": return "application/vnd.ms-excel.template.macroEnabled.12";
case "xlam": return "application/vnd.ms-excel.addin.macroEnabled.12";
case "xlsb": return "application/vnd.ms-excel.sheet.binary.macroEnabled.12";
case "ppt": return "application/vnd.ms-powerpoint";
case "pot": return "application/vnd.ms-powerpoint";
case "pps": return "application/vnd.ms-powerpoint";
case "ppa": return "application/vnd.ms-powerpoint";
case "pptx": return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
case "potx": return "application/vnd.openxmlformats-officedocument.presentationml.template";
case "ppsx": return "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
case "ppam": return "application/vnd.ms-powerpoint.addin.macroEnabled.12";
case "pptm": return "application/vnd.ms-powerpoint.presentation.macroEnabled.12";
case "potm": return "application/vnd.ms-powerpoint.template.macroEnabled.12";
case "ppsm": return "application/vnd.ms-powerpoint.slideshow.macroEnabled.12";
case "mdb": return "application/vnd.ms-access";

2

.Docx फ़ाइल लोड करने के लिए

    if let htmlFile = Bundle.main.path(forResource: "fileName", ofType: "docx") {
        let url = URL(fileURLWithPath: htmlFile)
        do{
            let data = try Data(contentsOf: url)
            self.webView.load(data, mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", textEncodingName: "UTF-8", baseURL: url)
        }catch{
            print("errrr")
        }
    }

2

Swift4

 func mimeTypeForPath(path: String) -> String {
        let url = NSURL(fileURLWithPath: path)
        let pathExtension = url.pathExtension

        if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension! as NSString, nil)?.takeRetainedValue() {
            if let mimetype = UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType)?.takeRetainedValue() {
                return mimetype as String
            }
        }
        return "application/octet-stream"
    }

1
MobileCoreServices
रॉबर्ट Veringa

0

मैपिंग सूची माइम प्रकारों को पॉप्युलेट करने के लिए एंड्रॉइड में एक कार्य पद्धति।

private static void fileMimeTypeMapping() {
     MIMETYPE_MAPPING.put("3gp", Collections.list("video/3gpp"));
     MIMETYPE_MAPPING.put("7z", Collections.list("application/x-7z-compressed"));
     MIMETYPE_MAPPING.put("accdb", Collections.list("application/msaccess"));
     MIMETYPE_MAPPING.put("ai", Collections.list("application/illustrator"));
     MIMETYPE_MAPPING.put("apk", Collections.list("application/vnd.android.package-archive"));
     MIMETYPE_MAPPING.put("arw", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("avi", Collections.list("video/x-msvideo"));
     MIMETYPE_MAPPING.put("bash", Collections.list("text/x-shellscript"));
     MIMETYPE_MAPPING.put("bat", Collections.list("application/x-msdos-program"));
     MIMETYPE_MAPPING.put("blend", Collections.list("application/x-blender"));
     MIMETYPE_MAPPING.put("bin", Collections.list("application/x-bin"));
     MIMETYPE_MAPPING.put("bmp", Collections.list("image/bmp"));
     MIMETYPE_MAPPING.put("bpg", Collections.list("image/bpg"));
     MIMETYPE_MAPPING.put("bz2", Collections.list("application/x-bzip2"));
     MIMETYPE_MAPPING.put("cb7", Collections.list("application/x-cbr"));
     MIMETYPE_MAPPING.put("cba", Collections.list("application/x-cbr"));
     MIMETYPE_MAPPING.put("cbr", Collections.list("application/x-cbr"));
     MIMETYPE_MAPPING.put("cbt", Collections.list("application/x-cbr"));
     MIMETYPE_MAPPING.put("cbtc", Collections.list("application/x-cbr"));
     MIMETYPE_MAPPING.put("cbz", Collections.list("application/x-cbr"));
     MIMETYPE_MAPPING.put("cc", Collections.list("text/x-c"));
     MIMETYPE_MAPPING.put("cdr", Collections.list("application/coreldraw"));
     MIMETYPE_MAPPING.put("class", Collections.list("application/java"));
     MIMETYPE_MAPPING.put("cnf", Collections.list("text/plain"));
     MIMETYPE_MAPPING.put("conf", Collections.list("text/plain"));
     MIMETYPE_MAPPING.put("cpp", Collections.list("text/x-c++src"));
     MIMETYPE_MAPPING.put("cr2", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("css", Collections.list("text/css"));
     MIMETYPE_MAPPING.put("csv", Collections.list("text/csv"));
     MIMETYPE_MAPPING.put("cvbdl", Collections.list("application/x-cbr"));
     MIMETYPE_MAPPING.put("c", Collections.list("text/x-c"));
     MIMETYPE_MAPPING.put("c++", Collections.list("text/x-c++src"));
     MIMETYPE_MAPPING.put("dcr", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("deb", Collections.list("application/x-deb"));
     MIMETYPE_MAPPING.put("dng", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("doc", Collections.list("application/msword"));
     MIMETYPE_MAPPING.put("docm", Collections.list("application/vnd.ms-word.document.macroEnabled.12"));
     MIMETYPE_MAPPING.put("docx", Collections.list("application/vnd.openxmlformats-officedocument.wordprocessingml.document"));
     MIMETYPE_MAPPING.put("dot", Collections.list("application/msword"));
     MIMETYPE_MAPPING.put("dotx", Collections.list("application/vnd.openxmlformats-officedocument.wordprocessingml.template"));
     MIMETYPE_MAPPING.put("dv", Collections.list("video/dv"));
     MIMETYPE_MAPPING.put("eot", Collections.list("application/vnd.ms-fontobject"));
     MIMETYPE_MAPPING.put("epub", Collections.list("application/epub+zip"));
     MIMETYPE_MAPPING.put("eps", Collections.list("application/postscript"));
     MIMETYPE_MAPPING.put("erf", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("exe", Collections.list("application/x-ms-dos-executable"));
     MIMETYPE_MAPPING.put("flac", Collections.list("audio/flac"));
     MIMETYPE_MAPPING.put("flv", Collections.list("video/x-flv"));
     MIMETYPE_MAPPING.put("gif", Collections.list("image/gif"));
     MIMETYPE_MAPPING.put("gpx", Collections.list("application/gpx+xml"));
     MIMETYPE_MAPPING.put("gz", Collections.list("application/gzip"));
     MIMETYPE_MAPPING.put("gzip", Collections.list("application/gzip"));
     MIMETYPE_MAPPING.put("h", Collections.list("text/x-h"));
     MIMETYPE_MAPPING.put("heic", Collections.list("image/heic"));
     MIMETYPE_MAPPING.put("heif", Collections.list("image/heif"));
     MIMETYPE_MAPPING.put("hh", Collections.list("text/x-h"));
     MIMETYPE_MAPPING.put("hpp", Collections.list("text/x-h"));
     MIMETYPE_MAPPING.put("htaccess", Collections.list("text/plain"));
     MIMETYPE_MAPPING.put("ical", Collections.list("text/calendar"));
     MIMETYPE_MAPPING.put("ics", Collections.list("text/calendar"));
     MIMETYPE_MAPPING.put("iiq", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("impress", Collections.list("text/impress"));
     MIMETYPE_MAPPING.put("java", Collections.list("text/x-java-source"));
     MIMETYPE_MAPPING.put("jp2", Collections.list("image/jp2"));
     MIMETYPE_MAPPING.put("jpeg", Collections.list("image/jpeg"));
     MIMETYPE_MAPPING.put("jpg", Collections.list("image/jpeg"));
     MIMETYPE_MAPPING.put("jps", Collections.list("image/jpeg"));
     MIMETYPE_MAPPING.put("k25", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("kdc", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("key", Collections.list("application/x-iwork-keynote-sffkey"));
     MIMETYPE_MAPPING.put("keynote", Collections.list("application/x-iwork-keynote-sffkey"));
     MIMETYPE_MAPPING.put("kml", Collections.list("application/vnd.google-earth.kml+xml"));
     MIMETYPE_MAPPING.put("kmz", Collections.list("application/vnd.google-earth.kmz"));
     MIMETYPE_MAPPING.put("kra", Collections.list("application/x-krita"));
     MIMETYPE_MAPPING.put("ldif", Collections.list("text/x-ldif"));
     MIMETYPE_MAPPING.put("love", Collections.list("application/x-love-game"));
     MIMETYPE_MAPPING.put("lwp", Collections.list("application/vnd.lotus-wordpro"));
     MIMETYPE_MAPPING.put("m2t", Collections.list("video/mp2t"));
     MIMETYPE_MAPPING.put("m3u", Collections.list("audio/mpegurl"));
     MIMETYPE_MAPPING.put("m3u8", Collections.list("audio/mpegurl"));
     MIMETYPE_MAPPING.put("m4a", Collections.list("audio/mp4"));
     MIMETYPE_MAPPING.put("m4b", Collections.list("audio/m4b"));
     MIMETYPE_MAPPING.put("m4v", Collections.list("video/mp4"));
     MIMETYPE_MAPPING.put("markdown", Collections.list(MIMETYPE_TEXT_MARKDOWN));
     MIMETYPE_MAPPING.put("mdown", Collections.list(MIMETYPE_TEXT_MARKDOWN));
     MIMETYPE_MAPPING.put("md", Collections.list(MIMETYPE_TEXT_MARKDOWN));
     MIMETYPE_MAPPING.put("mdb", Collections.list("application/msaccess"));
     MIMETYPE_MAPPING.put("mdwn", Collections.list(MIMETYPE_TEXT_MARKDOWN));
     MIMETYPE_MAPPING.put("mkd", Collections.list(MIMETYPE_TEXT_MARKDOWN));
     MIMETYPE_MAPPING.put("mef", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("mkv", Collections.list("video/x-matroska"));
     MIMETYPE_MAPPING.put("mobi", Collections.list("application/x-mobipocket-ebook"));
     MIMETYPE_MAPPING.put("mov", Collections.list("video/quicktime"));
     MIMETYPE_MAPPING.put("mp3", Collections.list("audio/mpeg"));
     MIMETYPE_MAPPING.put("mp4", Collections.list("video/mp4"));
     MIMETYPE_MAPPING.put("mpeg", Collections.list("video/mpeg"));
     MIMETYPE_MAPPING.put("mpg", Collections.list("video/mpeg"));
     MIMETYPE_MAPPING.put("mpo", Collections.list("image/jpeg"));
     MIMETYPE_MAPPING.put("msi", Collections.list("application/x-msi"));
     MIMETYPE_MAPPING.put("mts", Collections.list("video/MP2T"));
     MIMETYPE_MAPPING.put("mt2s", Collections.list("video/MP2T"));
     MIMETYPE_MAPPING.put("nef", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("numbers", Collections.list("application/x-iwork-numbers-sffnumbers"));
     MIMETYPE_MAPPING.put("odf", Collections.list("application/vnd.oasis.opendocument.formula"));
     MIMETYPE_MAPPING.put("odg", Collections.list("application/vnd.oasis.opendocument.graphics"));
     MIMETYPE_MAPPING.put("odp", Collections.list("application/vnd.oasis.opendocument.presentation"));
     MIMETYPE_MAPPING.put("ods", Collections.list("application/vnd.oasis.opendocument.spreadsheet"));
     MIMETYPE_MAPPING.put("odt", Collections.list("application/vnd.oasis.opendocument.text"));
     MIMETYPE_MAPPING.put("oga", Collections.list("audio/ogg"));
     MIMETYPE_MAPPING.put("ogg", Collections.list("audio/ogg"));
     MIMETYPE_MAPPING.put("ogv", Collections.list("video/ogg"));
     MIMETYPE_MAPPING.put("one", Collections.list("application/msonenote"));
     MIMETYPE_MAPPING.put("opus", Collections.list("audio/ogg"));
     MIMETYPE_MAPPING.put("orf", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("otf", Collections.list("application/font-sfnt"));
     MIMETYPE_MAPPING.put("pages", Collections.list("application/x-iwork-pages-sffpages"));
     MIMETYPE_MAPPING.put("pdf", Collections.list("application/pdf"));
     MIMETYPE_MAPPING.put("pfb", Collections.list("application/x-font"));
     MIMETYPE_MAPPING.put("pef", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("php", Collections.list("application/x-php"));
     MIMETYPE_MAPPING.put("pl", Collections.list("application/x-perl"));
     MIMETYPE_MAPPING.put("pls", Collections.list("audio/x-scpls"));
     MIMETYPE_MAPPING.put("png", Collections.list("image/png"));
     MIMETYPE_MAPPING.put("pot", Collections.list("application/vnd.ms-powerpoint"));
     MIMETYPE_MAPPING.put("potm", Collections.list("application/vnd.ms-powerpoint.template.macroEnabled.12"));
     MIMETYPE_MAPPING.put("potx", Collections.list("application/vnd.openxmlformats-officedocument.presentationml.template"));
     MIMETYPE_MAPPING.put("ppa", Collections.list("application/vnd.ms-powerpoint"));
     MIMETYPE_MAPPING.put("ppam", Collections.list("application/vnd.ms-powerpoint.addin.macroEnabled.12"));
     MIMETYPE_MAPPING.put("pps", Collections.list("application/vnd.ms-powerpoint"));
     MIMETYPE_MAPPING.put("ppsm", Collections.list("application/vnd.ms-powerpoint.slideshow.macroEnabled.12"));
     MIMETYPE_MAPPING.put("ppsx", Collections.list("application/vnd.openxmlformats-officedocument.presentationml.slideshow"));
     MIMETYPE_MAPPING.put("ppt", Collections.list("application/vnd.ms-powerpoint"));
     MIMETYPE_MAPPING.put("pptm", Collections.list("application/vnd.ms-powerpoint.presentation.macroEnabled.12"));
     MIMETYPE_MAPPING.put("pptx", Collections.list("application/vnd.openxmlformats-officedocument.presentationml.presentation"));
     MIMETYPE_MAPPING.put("ps", Collections.list("application/postscript"));
     MIMETYPE_MAPPING.put("psd", Collections.list("application/x-photoshop"));
     MIMETYPE_MAPPING.put("py", Collections.list("text/x-python"));
     MIMETYPE_MAPPING.put("raf", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("rar", Collections.list("application/x-rar-compressed"));
     MIMETYPE_MAPPING.put("reveal", Collections.list("text/reveal"));
     MIMETYPE_MAPPING.put("rss", Collections.list("application/rss+xml"));
     MIMETYPE_MAPPING.put("rtf", Collections.list("application/rtf"));
     MIMETYPE_MAPPING.put("rw2", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("schema", Collections.list("text/plain"));
     MIMETYPE_MAPPING.put("sgf", Collections.list("application/sgf"));
     MIMETYPE_MAPPING.put("sh-lib", Collections.list("text/x-shellscript"));
     MIMETYPE_MAPPING.put("sh", Collections.list("text/x-shellscript"));
     MIMETYPE_MAPPING.put("srf", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("sr2", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("tar", Collections.list("application/x-tar"));
     MIMETYPE_MAPPING.put("tar.bz2", Collections.list("application/x-bzip2"));
     MIMETYPE_MAPPING.put("tar.gz", Collections.list("application/x-compressed"));
     MIMETYPE_MAPPING.put("tbz2", Collections.list("application/x-bzip2"));
     MIMETYPE_MAPPING.put("tcx", Collections.list("application/vnd.garmin.tcx+xml"));
     MIMETYPE_MAPPING.put("tex", Collections.list("application/x-tex"));
     MIMETYPE_MAPPING.put("tgz", Collections.list("application/x-compressed"));
     MIMETYPE_MAPPING.put("tiff", Collections.list("image/tiff"));
     MIMETYPE_MAPPING.put("tif", Collections.list("image/tiff"));
     MIMETYPE_MAPPING.put("ttf", Collections.list("application/font-sfnt"));
     MIMETYPE_MAPPING.put("txt", Collections.list("text/plain"));
     MIMETYPE_MAPPING.put("vcard", Collections.list("text/vcard"));
     MIMETYPE_MAPPING.put("vcf", Collections.list("text/vcard"));
     MIMETYPE_MAPPING.put("vob", Collections.list("video/dvd"));
     MIMETYPE_MAPPING.put("vsd", Collections.list("application/vnd.visio"));
     MIMETYPE_MAPPING.put("vsdm", Collections.list("application/vnd.ms-visio.drawing.macroEnabled.12"));
     MIMETYPE_MAPPING.put("vsdx", Collections.list("application/vnd.ms-visio.drawing"));
     MIMETYPE_MAPPING.put("vssm", Collections.list("application/vnd.ms-visio.stencil.macroEnabled.12"));
     MIMETYPE_MAPPING.put("vssx", Collections.list("application/vnd.ms-visio.stencil"));
     MIMETYPE_MAPPING.put("vstm", Collections.list("application/vnd.ms-visio.template.macroEnabled.12"));
     MIMETYPE_MAPPING.put("vstx", Collections.list("application/vnd.ms-visio.template"));
     MIMETYPE_MAPPING.put("wav", Collections.list("audio/wav"));
     MIMETYPE_MAPPING.put("webm", Collections.list("video/webm"));
     MIMETYPE_MAPPING.put("woff", Collections.list("application/font-woff"));
     MIMETYPE_MAPPING.put("wpd", Collections.list("application/vnd.wordperfect"));
     MIMETYPE_MAPPING.put("wmv", Collections.list("video/x-ms-wmv"));
     MIMETYPE_MAPPING.put("xcf", Collections.list("application/x-gimp"));
     MIMETYPE_MAPPING.put("xla", Collections.list("application/vnd.ms-excel"));
     MIMETYPE_MAPPING.put("xlam", Collections.list("application/vnd.ms-excel.addin.macroEnabled.12"));
     MIMETYPE_MAPPING.put("xls", Collections.list("application/vnd.ms-excel"));
     MIMETYPE_MAPPING.put("xlsb", Collections.list("application/vnd.ms-excel.sheet.binary.macroEnabled.12"));
     MIMETYPE_MAPPING.put("xlsm", Collections.list("application/vnd.ms-excel.sheet.macroEnabled.12"));
     MIMETYPE_MAPPING.put("xlsx", Collections.list("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"));
     MIMETYPE_MAPPING.put("xlt", Collections.list("application/vnd.ms-excel"));
     MIMETYPE_MAPPING.put("xltm", Collections.list("application/vnd.ms-excel.template.macroEnabled.12"));
     MIMETYPE_MAPPING.put("xltx", Collections.list("application/vnd.openxmlformats-officedocument.spreadsheetml.template"));
     MIMETYPE_MAPPING.put("xrf", Collections.list("image/x-dcraw"));
     MIMETYPE_MAPPING.put("yaml", Arrays.asList("application/yaml", "text/plain"));
     MIMETYPE_MAPPING.put("yml", Arrays.asList("application/yaml", "text/plain"));
     MIMETYPE_MAPPING.put("zip", Collections.list("application/zip"));
     MIMETYPE_MAPPING.put("url", Collections.list("application/internet-shortcut"));
     MIMETYPE_MAPPING.put("webloc", Collections.list("application/internet-shortcut"));
     MIMETYPE_MAPPING.put("js", Arrays.asList("application/javascript", "text/plain"));
     MIMETYPE_MAPPING.put("json", Arrays.asList("application/json", "text/plain"));
     MIMETYPE_MAPPING.put("fb2", Arrays.asList("application/x-fictionbook+xml", "text/plain"));
     MIMETYPE_MAPPING.put("html", Arrays.asList("text/html", "text/plain"));
     MIMETYPE_MAPPING.put("htm", Arrays.asList("text/html", "text/plain"));
     MIMETYPE_MAPPING.put("m", Arrays.asList("text/x-matlab", "text/plain"));
     MIMETYPE_MAPPING.put("svg", Arrays.asList("image/svg+xml", "text/plain"));
     MIMETYPE_MAPPING.put("swf", Arrays.asList("application/x-shockwave-flash", "application/octet-stream"));
     MIMETYPE_MAPPING.put("xml", Arrays.asList("application/xml", "text/plain"));

}

हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.