日期:2014-05-20  浏览次数:20416 次

关于文件下载的问题 ---好几天了 一直处理不了 高手帮帮忙
Page.Response.Clear();

                Response.ContentType   =   "application/octet-stream ";
                Response.AddHeader( "Content-Disposition ",   "attachment;   filename= "   +   HttpUtility.UrlEncode(filename,   System.Text.Encoding.UTF8));

                Response.Flush();
                Response.WriteFile(filepath);

                Page.Response.End();

代码如上.   能弹出IE的下载框,但是直接点击打开的话会提示找不到文件.   点击保存则功能正常.

------解决方案--------------------
点击保存我想也应该是找不到文件, 你看看保存在本地的文件的内容,里面是不是有找不到文件的错误?
------解决方案--------------------
点击保存功能正常——保存的文件你打开确认过了?