Asp.net-016:asp.net the Save File dialog box

Source: Internet
Author: User
Tags dbx fdf gcd pkcs12 pkcs7 rfc822 save file

To save the file in ASP. Savediallog, the result is that the Display modal dialog box or window is invalid when the application is not executing in userinteractive mode.


This is used in the following way, for example in ASP. Save the file. The following example saves an Excel file.

            Response.ContentType = @ "Application/x-xls";            Response.appendheader ("Content-disposition", "attachment; Filename= "+ @" \test.xls ");            The content is written to a file here, such as            Response.Flush ();            Response.WriteFile ("File containing content", true);            Response.Write (number of references);            Response.End ();
The code is very easy.

The example above. Performance effects such as the following:


ContentType represents the file type.
Appendheader is a prompt dialog box that lets you choose to save the file.
The Response.WriteFile and Response.Write methods are based on the need to have documents or content. For example, a string. The file stream is written to the saved file.



A file type has for example the following:

". *" = "Application/octet-stream" ". 001" = "application/x-001" ". 301" = "application/x-301" ". 3 "=" 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/b            ASIC "". avi "=" Video/avi "". Awf "=" Application/vnd.adobe.workflow "". Biz "=" Text/xml " ". bmp" = "application/x-bmp" ". Bot" = "Application/x-bot" ". c4t" = "application/x-c4t" ". C            "=" 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" = "Applica TION/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" = "appli            Cation/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" = "applicat Ion/x-jpg "". js "=" Application/x-javascript "". jsp "=" text/html "". La1 "=" Audio/x-liquid-fil E "". Lar "=" Application/x-laplayer-reg "". Latex "=" Application/x-latex "". LAVs "=" Audio/x-li Quid-secure "". LBM "=" APPLICATION/X-LBM "". Lmsff "=" Audio/x-la-lms "". ls "=" Application/x-ja            Vascript "". Ltr "=" application/x-ltr "". m1v "=" Video/x-mpeg "". m2v "=" Video/x-mpeg " ". m3u" = "Audio/mpegurl" ". m4e" = "VIDEO/MPEG4" ". Mac" = "Application/x-mac" ". Man" = "Applica Tion/x-troff-man "". Math "=" Text/xml "". mdb "=" application/msaccess "". mdb "=" application/x- MDB "". MFP "=" Application/x-shockwave-flash "". mht "=" message/rfc822 "". mhtml "=" message/rfc 822 "". 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" ". M P2 "=" 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 "=" VI            Deo/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" ". NW S "=" 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" = "AP            Plication/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-rm J "". Rmm "=" Audio/x-pn-realaudio "". RMP "=" Application/vnd.rn-rn_music_package "". RMS "=" app Lication/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" = "Applicati            On/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" = "appli            Cation/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 "=" app            Lication/x-tga ". tif" = "Image/tiff" ". tif" = "application/x-tif" ". Tiff" = "Image/tiff" ". TLD" = "Text/xml" ". Top" = "drawing/x-top" ". Torrent" = "application/x-bittorrent" ". ts            D "=" 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" = "applicat Ion/x-vsd "". vss "=" Application/vnd.visio "". vst "=" Application/vnd.visio "". vst "=" applicat Ion/x-vst "". Vsw "=" Application/vnd.visio "". Vsx "=" Application/vnd.visio "". vtx "=" applicat          Ion/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" ". W PL "=" 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" ". W sc "=" Text/scriptlet "". wsdl "=" Text/xml "". wvx "=" video/x-ms-wvx "". Xdp "=" application/vnd.a DOBE.XDP "". XDR "=" Text/xml "". XfD "=" Application/vnd.adobe.xfd "". Xfdf "=" application/vnd.a Dobe.xfdf "". xhtml "=" text/html "". xls "=" application/vnd.ms-excel "". xls "=" application/x-x LS "". xlw "=" APPLICATION/X-XLW "". xml "=" Text/xml "". xPL "=" Audio/scpls "". Xq "=" t Ext/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"

Asp.net-016:asp.net the Save File dialog box

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.