ContenType type Daquan (including Office2007 documents solution to the problem)

2010-10-12  来源:本站原创  分类:Web  人气:245 

Standard reference

content-type is used to define the user's browser how to display or related equipment, the data will be loaded, or how the data will be loaded, the value of this property can be viewed MIME type.

MIME (Multipurpose Internet Mail Extensions, Multipurpose Internet Mail Extensions) is a description of the message content type of Internet standards. MIME messages can contain text, images, audio, video and other application specific data.

content-type generally in the form below:

Content-Type: [type]/[subtype]; parameter

type has the following form:

  • Text: used to standardize the way that text message, text message can be a variety of character sets and or a variety of formats;
  • Multipart: used to connect the various parts of the message body of a message, these parts can be different types of data;
  • Application: used to transmit application data or binary data;
  • Message: used to wrap an E-mail messages;
  • Image: used to transmit static image data;
  • Audio: for transmitting audio or voice data;
  • Video: for the transmission of video data can be edited together the video and audio data formats.

subtype used to specify the type of detailed forms. "Type / subtype" a collection of matching and the related parameters. Here are some of the most frequently used MIME types:

  • text / html (HTML document);
  • text / plain (plain text);
  • text / css (CSS style sheets);
  • image / gif (GIF image);
  • image / jpeg (JPG image);
  • application / x-javascript (JavaScript script);
  • application / x-shockwave-flash (Flash);
  • application/x- www-form-urlencoded (using the HTTP POST method to submit form);
  • multipart / form-data (as above, but is mainly used for file upload form is submitted along with the occasion.)

Problems may arise

(1) In IE6 IE7 IE8, if a page is opened when the received response header content-type is text / plain, the browser will try to sniff the actual content within the page file to determine the possibility of a HTML document, if will be in text / html page as a way to explain the HTML document, rather than deal with it as plain text.

The solution: use the attachment

(2) jpg, tmp, png and other format picture is no way to use windows Picture and Fax Viewer opens directly

The solution: use the attachment

(3) docx, pptx format files such as Office2007 browser error may be recognized as a zip format file download or open

The solution:

"Application / vnd.openxmlformats-officedocument.wordprocessingml.document" (for. Docx files)
"Application / vnd.openxmlformats-officedocument.wordprocessingml.template" (for. Dotx files)
"Application / vnd.openxmlformats-officedocument.presentationml.presentation" (for. Pptx files)
"Application / vnd.openxmlformats-officedocument.presentationml.slideshow" (for. Ppsx files)
"Application / vnd.openxmlformats-officedocument.presentationml.template" (for. Potx files)
"Application / vnd.openxmlformats-officedocument.spreadsheetml.sheet" (for. Xlsx files)
"Application / vnd.openxmlformats-officedocument.spreadsheetml.template" (for. Xltx files)

Type reference list

".*"=" Application / octet-stream "
".001" = "Application/x-001"
".301" = "Application/x-301"
".323" = "Text/h323"
".906" = "Application/x-906"
".907" = "Drawing/907"
". A11" = "application/x-a11"
". Acp" = "audio / x-mei-aac"
". Ai" = "application / postscript"
". Aif" = "audio / aiff"
". Aifc" = "audio / aiff"
". Aiff" = "audio / aiff"
". Anv" = "application / x-anv"
". Asa" = "text / asa"
". Asf" = "video / x-ms-asf"
". Asp" = "text / asp"
". Asx" = "video / x-ms-asf"
". Au" = "audio / basic"
". Avi" = "video / avi"
". Awf" = "application / vnd.adobe.workflow"
". Biz" = "text / xml"
". Bmp" = "application / x-bmp"
". Bot" = "application / x-bot"
". C4t" = "application/x-c4t"
". C90" = "application/x-c90"
". Cal" = "application / x-cals"
". Cat" = "application / vnd.ms-pki.seccat"
". Cdf" = "application / x-netcdf"
". Cdr" = "application / x-cdr"
". Cel" = "application / x-cel"
". Cer" = "application/x-x509-ca-cert"
". Cg4" = "application/x-g4"
". Cgm" = "application / x-cgm"
". Cit" = "application / x-cit"
". Class" = "java / *"
". Cml" = "text / xml"
". Cmp" = "application / x-cmp"
". Cmx" = "application / x-cmx"
". Cot" = "application / x-cot"
". Crl" = "application / pkix-crl"
". Crt" = "application/x-x509-ca-cert"
". Csi" = "application / x-csi"
". Css" = "text / css"
". Cut" = "application / x-cut"
". Dbf" = "application / x-dbf"
". Dbm" = "application / x-dbm"
". Dbx" = "application / x-dbx"
". Dcd" = "text / xml"
". Dcx" = "application / x-dcx"
". Der" = "application/x-x509-ca-cert"
". Dgn" = "application / x-dgn"
". Dib" = "application / x-dib"
". Dll" = "application / x-msdownload"
". Doc" = "application / msword"
". Dot" = "application / msword"
". Drw" = "application / x-drw"
". Dtd" = "text / xml"
". Dwf" = "Model / vnd.dwf"
". Dwf" = "application / x-dwf"
". Dwg" = "application / x-dwg"
". Dxb" = "application / x-dxb"
". Dxf" = "application / x-dxf"
". Edn" = "application / vnd.adobe.edn"
". Emf" = "application / x-emf"
". Eml" = "message/rfc822"
". Ent" = "text / xml"
". Epi" = "application / x-epi"
". Eps" = "application / x-ps"
". Eps" = "application / postscript"
". Etd" = "application / x-ebx"
". Exe" = "application / x-msdownload"
". Fax" = "image / fax"
". Fdf" = "application / vnd.fdf"
". Fif" = "application / fractals"
". Fo" = "text / xml"
". Frm" = "application / x-frm"
". G4" = "application/x-g4"
". Gbr" = "application / x-gbr"
". Gcd" = "application / x-gcd"
". Gif" = "image / gif"
". Gl2" = "application/x-gl2"
". Gp4" = "application/x-gp4"
". Hgl" = "application / x-hgl"
". Hmr" = "application / x-hmr"
". Hpg" = "application / x-hpgl"
". Hpl" = "application / x-hpl"
". Hqx" = "application/mac-binhex40"
". Hrf" = "application / x-hrf"
". Hta" = "application / hta"
". Htc" = "text / x-component"
". Htm" = "text / html"
". Html" = "text / html"
". Htt" = "text / webviewhtml"
". Htx" = "text / html"
". Icb" = "application / x-icb"
". Ico" = "image / x-icon"
". Ico" = "application / x-ico"
". Iff" = "application / x-iff"
". Ig4" = "application/x-g4"
". Igs" = "application / x-igs"
". Iii" = "application / x-iphone"
". Img" = "application / x-img"
". Ins" = "application / x-internet-signup"
". Isp" = "application / x-internet-signup"
". IVF" = "video / x-ivf"
". Java" = "java / *"
". Jfif" = "image / jpeg"
". Jpe" = "image / jpeg"
". Jpe" = "application / x-jpe"
". Jpeg" = "image / jpeg"
". Jpg" = "image / jpeg"
". Jpg" = "application / x-jpg"
". Js" = "application / x-javascript"
". Jsp" = "text / html"
". La1" = "audio / x-liquid-file"
". Lar" = "application / x-laplayer-reg"
". Latex" = "application / x-latex"
". Lavs" = "audio / x-liquid-secure"
". Lbm" = "application / x-lbm"
". Lmsff" = "audio / x-la-lms"
". Ls" = "application / x-javascript"
". Ltr" = "application / x-ltr"
". M1v" = "video / x-mpeg"
". M2v" = "video / x-mpeg"
". M3u" = "audio / mpegurl"
". M4e" = "video/mpeg4"
". Mac" = "application / x-mac"
". Man" = "application / x-troff-man"
". Math" = "text / xml"
". Mdb" = "application / msaccess"
". Mdb" = "application / x-mdb"
". Mfp" = "application / x-shockwave-flash"
". Mht" = "message/rfc822"
". Mhtml" = "message/rfc822"
". Mi" = "application / x-mi"
". Mid" = "audio / mid"
". Midi" = "audio / mid"
". Mil" = "application / x-mil"
". Mml" = "text / xml"
". Mnd" = "audio / x-musicnet-download"
". Mns" = "audio / x-musicnet-stream"
". Mocha" = "application / x-javascript"
". Movie" = "video / x-sgi-movie"
". Mp1" = "audio/mp1"
". Mp2" = "audio/mp2"
". Mp2v" = "video / mpeg"
". Mp3" = "audio/mp3"
". Mp4" = "video/mpeg4"
". Mpa" = "video / x-mpg"
". Mpd" = "application / vnd.ms-project"
". Mpe" = "video / x-mpeg"
". Mpeg" = "video / mpg"
". Mpg" = "video / mpg"
". Mpga" = "audio / rn-mpeg"
". Mpp" = "application / vnd.ms-project"
". Mps" = "video / x-mpeg"
". Mpt" = "application / vnd.ms-project"
". Mpv" = "video / mpg"
". Mpv2" = "video / mpeg"
". Mpw" = "application / vnd.ms-project"
". Mpx" = "application / vnd.ms-project"
". Mtx" = "text / xml"
". Mxp" = "application / x-mmxp"
". Net" = "image / pnetvue"
". Nrf" = "application / x-nrf"
". Nws" = "message/rfc822"
". Odc" = "text / x-ms-odc"
". Out" = "application / x-out"
". P10" = "application/pkcs10"
". P12" = "application/x-pkcs12"
". P7b" = "application/x-pkcs7-certificates"
". P7c" = "application/pkcs7-mime"
". P7m" = "application/pkcs7-mime"
". P7r" = "application/x-pkcs7-certreqresp"
". P7s" = "application/pkcs7-signature"
". Pc5" = "application/x-pc5"
". Pci" = "application / x-pci"
". Pcl" = "application / x-pcl"
". Pcx" = "application / x-pcx"
". Pdf" = "application / pdf"
". Pdf" = "application / pdf"
". Pdx" = "application / vnd.adobe.pdx"
". Pfx" = "application/x-pkcs12"
". Pgl" = "application / x-pgl"
". Pic" = "application / x-pic"
". Pko" = "application / vnd.ms-pki.pko"
". Pl" = "application / x-perl"
". Plg" = "text / html"
". Pls" = "audio / scpls"
". Plt" = "application / x-plt"
". Png" = "image / png"
". Png" = "application / x-png"
". Pot" = "application / vnd.ms-powerpoint"
". Ppa" = "application / vnd.ms-powerpoint"
". Ppm" = "application / x-ppm"
". Pps" = "application / vnd.ms-powerpoint"
". Ppt" = "application / vnd.ms-powerpoint"
". Ppt" = "application / x-ppt"
". Pr" = "application / x-pr"
". Prf" = "application / pics-rules"
". Prn" = "application / x-prn"
". Prt" = "application / x-prt"
". Ps" = "application / x-ps"
". Ps" = "application / postscript"
". Ptn" = "application / x-ptn"
". Pwz" = "application / vnd.ms-powerpoint"
". R3t" = "text/vnd.rn-realtext3d"
". Ra" = "audio / vnd.rn-realaudio"
". Ram" = "audio / x-pn-realaudio"
". Ras" = "application / x-ras"
". Rat" = "application / rat-file"
". Rdf" = "text / xml"
". Rec" = "application / vnd.rn-recording"
". Red" = "application / x-red"
". Rgb" = "application / x-rgb"
". Rjs" = "application / vnd.rn-realsystem-rjs"
". Rjt" = "application / vnd.rn-realsystem-rjt"
". Rlc" = "application / x-rlc"
". Rle" = "application / x-rle"
". Rm" = "application / vnd.rn-realmedia"
". Rmf" = "application / vnd.adobe.rmf"
". Rmi" = "audio / mid"
". Rmj" = "application / vnd.rn-realsystem-rmj"
". Rmm" = "audio / x-pn-realaudio"
". Rmp" = "application / vnd.rn-rn_music_package"
". Rms" = "application / vnd.rn-realmedia-secure"
". Rmvb" = "application / vnd.rn-realmedia-vbr"
". Rmx" = "application / vnd.rn-realsystem-rmx"
". Rnx" = "application / vnd.rn-realplayer"
". Rp" = "image / vnd.rn-realpix"
". Rpm" = "audio / x-pn-realaudio-plugin"
". Rsml" = "application / vnd.rn-rsml"
". Rt" = "text / vnd.rn-realtext"
". Rtf" = "application / msword"
". Rtf" = "application / x-rtf"
". Rv" = "video / vnd.rn-realvideo"
". Sam" = "application / x-sam"
". Sat" = "application / x-sat"
". Sdp" = "application / sdp"
". Sdw" = "application / x-sdw"
". Sit" = "application / x-stuffit"
". Slb" = "application / x-slb"
". Sld" = "application / x-sld"
". Slk" = "drawing / x-slk"
". Smi" = "application / smil"
". Smil" = "application / smil"
". Smk" = "application / x-smk"
". Snd" = "audio / basic"
". Sol" = "text / plain"
". Sor" = "text / plain"
". Spc" = "application/x-pkcs7-certificates"
". Spl" = "application / futuresplash"
". Spp" = "text / xml"
". Ssm" = "application / streamingmedia"
". Sst" = "application / vnd.ms-pki.certstore"
". Stl" = "application / vnd.ms-pki.stl"
". Stm" = "text / html"
". Sty" = "application / x-sty"
". Svg" = "text / xml"
". Swf" = "application / x-shockwave-flash"
". Tdf" = "application / x-tdf"
". Tg4" = "application/x-tg4"
". Tga" = "application / x-tga"
". Tif" = "image / tiff"
". Tif" = "application / x-tif"
". Tiff" = "image / tiff"
". Tld" = "text / xml"
". Top" = "drawing / x-top"
". Torrent" = "application / x-bittorrent"
". Tsd" = "text / xml"
". Txt" = "text / plain"
". Uin" = "application / x-icq"
". Uls" = "text / iuls"
". Vcf" = "text / x-vcard"
". Vda" = "application / x-vda"
". Vdx" = "application / vnd.visio"
". Vml" = "text / xml"
". Vpg" = "application/x-vpeg005"
". Vsd" = "application / vnd.visio"
". Vsd" = "application / x-vsd"
". Vss" = "application / vnd.visio"
". Vst" = "application / vnd.visio"
". Vst" = "application / x-vst"
". Vsw" = "application / vnd.visio"
". Vsx" = "application / vnd.visio"
". Vtx" = "application / vnd.visio"
". Vxml" = "text / xml"
". Wav" = "audio / wav"
". Wax" = "audio / x-ms-wax"
". Wb1" = "application/x-wb1"
". Wb2" = "application/x-wb2"
". Wb3" = "application/x-wb3"
". Wbmp" = "image / vnd.wap.wbmp"
". Wiz" = "application / msword"
". Wk3" = "application/x-wk3"
". Wk4" = "application/x-wk4"
". Wkq" = "application / x-wkq"
". Wks" = "application / x-wks"
". Wm" = "video / x-ms-wm"
". Wma" = "audio / x-ms-wma"
". Wmd" = "application / x-ms-wmd"
". Wmf" = "application / x-wmf"
". Wml" = "text / vnd.wap.wml"
". Wmv" = "video / x-ms-wmv"
". Wmx" = "video / x-ms-wmx"
". Wmz" = "application / x-ms-wmz"
". Wp6" = "application/x-wp6"
". Wpd" = "application / x-wpd"
". Wpg" = "application / x-wpg"
". Wpl" = "application / vnd.ms-wpl"
". Wq1" = "application/x-wq1"
". Wr1" = "application/x-wr1"
". Wri" = "application / x-wri"
". Wrk" = "application / x-wrk"
". Ws" = "application / x-ws"
". Ws2" = "application / x-ws"
". Wsc" = "text / scriptlet"
". Wsdl" = "text / xml"
". Wvx" = "video / x-ms-wvx"
". Xdp" = "application / vnd.adobe.xdp"
". Xdr" = "text / xml"
". Xfd" = "application / vnd.adobe.xfd"
". Xfdf" = "application / vnd.adobe.xfdf"
". Xhtml" = "text / html"
". Xls" = "application / vnd.ms-excel"
". Xls" = "application / x-xls"
". Xlw" = "application / x-xlw"
". Xml" = "text / xml"
". Xpl" = "audio / scpls"
". Xq" = "text / xml"
". Xql" = "text / xml"
". Xquery" = "text / xml"
". Xsd" = "text / xml"
". Xsl" = "text / xml"
". Xslt" = "text / xml"
". Xwd" = "application / x-xwd"
". X_b" = "application / x-x_b"
". X_t" = "application / x-x_t"

相关文章