Response.ContentType = Response.AppendHeader(, Response.TransmitFile(Server.MapPath( Response.End();
. Htm,. htmlResponse. ContentType = "text/HTML";. txtResponse. ContentType = "text/plain";. doc,. rtf,. docxResponse. ContentType = "Application/msword";. xls,. xlsxResponse. ContentType = "Application/x-msexcel";. jpg,. jpegResponse. ContentType = "image/jpeg";. gifResponse. ContentType = "image/GIF";. pdfResponse. ContentType = "application/pdf ";
Button#click (path = Request. physicalApplicationPath ++ Session []. toString () ++ Session []. toString () + System. IO. stream iStream = [] buffer = Byte [filename = Session []. toString () + iStream = dataToRead = Response. contentType =; Response. addHeader (, dataToRead. toString (); Response. addHeader (, + (dataToRead> length = iStream. read (buffer, Response. outputStream. write (buffer, buffer = Byte [dat AToRead = dataToRead-dataToRead =-Response. Write (iStream! =}
With the above code, you can open a "Open/Save" dialog box in the browser to download and save the file.