-----------倾家荡产70分求解excle从服务器保存到客户端问题--------------
奇怪问题向大家讨教,本人用这段代码从本机一个文件保存,可以弹出对话框要下载文件,而且我设置断点,可以读入字节,但是总是保存本页面什么原因???
FileStream myFile = File.OpenRead("D:\\tt.xls");
byte[] fileCont = new byte[myFile.Length];
myFile.Read(fileCont,0,(int)myFile.Length);
Page.Response.Clear();
Page.Response.AddHeader( "Content-Type", "application/vnd.ms-excel" );
Page.Response.AddHeader("Content-Disposition", "attachment;filename=" + "tt.xls" );
Page.Response.AddHeader("Content-Length", myFile.Length.ToString());
Page.Response.BinaryWrite(fileCont);
Page.Response.End();