String Path = server. mappath (this. xlfile. Text + ". xls ");
System. Io. fileinfo file = new system. Io. fileinfo (PATH );
Response. Clear ();
Response. charset = "gb2312 ";
Response. contentencoding = system. Text. encoding. utf8;
// Add the header information and specify the default file name for the "download/Save as" dialog box
Response. addheader ("content-disposition", "attachment; filename =" + server. urlencode (file. Name ));
// Add header information and specify the file size so that the browser can display the download progress.
Response. addheader ("Content-Length", file. length. tostring ());
// Specify a stream that cannot be read by the client and must be downloaded.
Response. contenttype = "application/MS-excel ";
// Send the file stream to the client
Response. writefile (file. fullname );
// Stop page execution
Response. End ();
Use the above method
Why is there another download prompt after the download prompt is clicked and saved? download this page, for example, my page
1. aspx upload prompt to download 1.aspx.htm
Thank you.