PHP header sends various types of file downloads

Source: Internet
Author: User
Tags dbx fdf pkcs12 pkcs7 rfc822 gtar
Document directory
  •  

Header ('content-type: Application/image/pjpeg '); // output type
Header ('content-Disposition: attachment; filename = "downloaded.jpg" '); // download the name displayed. Note the format.
Readfile('my.jpg ');
// Set the type of the file header to be sent, and a download box will pop up.
// Download the my.jpg file on the server. The downloaded display and saved name are downloaded.jpg.
?>
The output types of various file types are as follows:
'Chm' => 'application/octet-stream ',
'Ppt '=> 'application/vnd. MS-PowerPoint ',
'Xls '=> 'application/vnd. MS-Excel ',
'Doc' => 'application/msword ',
'Exe '=> 'application/octet-stream ',
'Rar '=> 'application/octet-stream ',
'Js' => "using Cr Using Pt/JS ",
'Css '=> "text/CSS ",
'Hqx' => "application/mac-binhex40 ",
'Bin' => "application/octet-stream ",
'Oda '=> "application/ODA ",
'Pdf '=> "application/pdf ",
'Ai' => "application/postsrcipt ",
'Eps '=> "application/postsrcipt ",
'Els' => "application/postsrcipt ",
'Rtf '=> "application/rtf ",
'Miff' => "application/X-MIF ",
'Csh' => "application/X-CSH ",
'Dvi '=> "application/X-DVI ",
'Hdf' => "application/X-HDF ",
'Nc '=> "application/X-netcdf ",
'Cdf' => "application/X-netcdf ",
'Latex '=> "application/X-latex ",
'Ts' => "application/X-troll-ts ",
'Src' => "application/X-WAIS-source ",
'Zip' => "application/zip ",
'Bcpio' => "application/X-bcpio ",
'Cpio' => "application/X-cpio ",
'Gtar '=> "application/X-gtar ",
'Shar '=> "application/X-shar ",
'Sv4cpio '=> "application/x-sv4cpio ",
'Sv4crc '=> "application/x-sv4crc ",
'Tar '=> "application/X-tar ",
'Ustar' => "application/X-USTAR ",
'Man' => "application/X-troff-man ",
'Sh' => "application/X-sh ",
'Tcl '=> "application/X-tcl ",
'Tex '=> "application/X-Tex ",
'Text' => "application/X-texinfo ",
'Textinfo' => "application/X-texinfo ",
'T' => "application/X-troff ",
'Tr' => "application/X-troff ",
'Roff' => "application/X-troff ",
'Shar '=> "application/X-shar ",
'Me' => "application/X-troll-me ",
'Ts' => "application/X-troll-ts ",
'Gif' => "image/GIF ",
'Jpeg '=> "image/pjpeg ",
'Jpg '=> "image/pjpeg ",
'Jpe' => "image/pjpeg ",
'Ras '=> "image/X-CMU-raster ",
'Pbm' => "image/X-portable-bitmap ",
'Ppm '=> "image/X-portable-pixmap ",
'Xbm '=> "image/X-xbitmap ",
'Xwd '=> "image/X-xwindowdump ",
'Ief' => "image/IEF ",
'Tif '=> "image/tiff ",
'Tiff '=> "image/tiff ",
'Pnm '=> "image/X-portable-anymap ",
'Pgm '=> "image/X-portable-graymap ",
'Rgb '=> "image/X-RGB ",
'Xpm' => "image/X-xpixmap ",
'Txt '=> "text/plain ",
'C' => "text/plain ",
'Cc' => "text/plain ",
'H' => "text/plain ",
'Html' => "text/html ",
'Htm '=> "text/html ",
'Htl' => "text/html ",
'Rtx' => "text/richtext ",
'Etx' => "text/X-setext ",
'Tsv' => "text/TAB-separated-values ",
'Mpeg '=> "Video/MPEG ",
'Mpg' => "Video/MPEG ",
'Mpe' => "Video/MPEG ",
'Av' => "Video/X-msvideo ",
'Qt '=> "Video/QuickTime ",
'Mov' => "Video/QuickTime ",
'Moov '=> "Video/QuickTime ",
'Movie '=> "Video/X-SGI-movie ",
'Au '=> "audio/basic ",
'Snd' => "audio/basic ",
'Wav '=> "audio/X-WAV ",
'Aif' => "audio/X-AIFF ",
'Aiff '=> "audio/X-AIFF ",
'Aifc '=> "audio/X-AIFF ",
'Swf '=> "application/X-Shockwave-flash"
'Myz' => "application/myz"
". *" = "Application/octet-stream"
". 001" = "application/x-001"
". 301" = "application/x-301"
". 323" = "text/h323"
". 906" = "application/x-906"
". 907" = "Fig/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 /*"
". CRF" = "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"
". Ig" = "application/X-ig"
". 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"
". CTX" = "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"
". Sealing" = "application/vnd. Visio"
". Sealing" = "application/X-sealing"
". 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"
". Myz" = "application/myz"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.