<1>
Htmlpage1.htm page
<HTML xmlns = "http://www.w3.org/1999/xhtml">
Download handler1.ashx. CS
Using system; using system. collections. generic; using system. LINQ; using system. web; namespace webapplication3 {// <summary> // download the abstract description of handler1 /// </Summary> public class download handler1: ihttphandler {public void processrequest (httpcontext context) {context. response. contenttype = "image/JPEG"; string filename = context. server. urldecode ("haha.jpg"); // Add a message header. "content-disposition", "attachment; filename = "when the file is opened, it will pop up as a downloaded file. // if this header is not added, the file"/images/111.jpg" will be written to the browser, when the image is displayed in the browser // attachment; filename = "+ filenameits actual download, The 111.jpg file will be taken as the" Haha "alias context. response. addheader ("content-disposition", "attachment; filename =" + filename); // The name of the file to be downloaded. context. response. writefile ("/images/111.jpg"); // ---- Note: writefile} public bool isreusable {get {return false ;}}}}
Zookeeper