FileInfo fi = new FileInfo(Server.MapPath(Request.ApplicationPath.ToString()+"\\MyDoc\\"+FileName));
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.ContentType = "application/octet-stream" ;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fi.FullName, System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length", fi.Length.ToString()) ;
Response.WriteFile(fi.FullName);
Response.Flush();
Response.Close(); 如果我直接打开这个文件是页面仍然可以提交,如果我保存到本地页面就不能提交了
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.ContentType = "application/octet-stream" ;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fi.FullName, System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length", fi.Length.ToString()) ;
Response.WriteFile(fi.FullName);
Response.Flush();
Response.Close(); 如果我直接打开这个文件是页面仍然可以提交,如果我保存到本地页面就不能提交了
解决方案 »
- 请教一条sql语句
- 静态的table,内含动态tableRow和tableCell,tableCell中有动态dropdownlist,fileUpload等,如何查找后者的控件?
- vs2010中ajax登录不了
- (SOS)有一定WinForm和WebForm基础,如何学习MVC和WCF并把三层架构项目转为MVC/WCF架构造?
- 懂Flash和js的请进,基础问题
- 求解释!!!
- 我挣了几十分,怎么没有给我加上呢?
- “/”应用程序中的服务器错误。 麻烦老大给看看怎么回事,我是菜鸟,给解释详细点,谢谢
- Session值更新问题
- ASP.NET中怎样使用LISTVIEW组件
- 求如何把一个example.aspx页变成一个example.ascx用户控件,然后放在index.aspx中,且实现原example.aspx的功能?
- asp.net程序员请进
你的Response已经关闭了
response.end();
response.start();