Page.Response.Clear();
Page.Response.ContentType = "Application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(savingFileName));----------1
Page.Response.WriteFile(Configuration.UploadedFilesStoragePosition+"//"+filename);
Page.Response.Flush();
Page.Response.End();向http 输出流时,在win 2K 下没有问题,而在Xp-Sp2 ,会把窗口关闭。很郁闷。不知道大家有没有遇到过 Xp-Sp2 的问题,希望高手帮忙
Page.Response.ContentType = "Application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(savingFileName));----------1
Page.Response.WriteFile(Configuration.UploadedFilesStoragePosition+"//"+filename);
Page.Response.Flush();
Page.Response.End();向http 输出流时,在win 2K 下没有问题,而在Xp-Sp2 ,会把窗口关闭。很郁闷。不知道大家有没有遇到过 Xp-Sp2 的问题,希望高手帮忙
你这个UrlEncode(savingFileName));----------1,后面这一段什么意思?
---------------------------------
我猜一个可能性,不一定准确
是因为你的savingFileName这个名字太长了,就会引起问题.你试试看把它变短一点,比如说固定输入一个"文件名"这样的名称,看它会不会出错.
关键在Page.Response.ContentType = "Application/octet-stream";这一句我以前在win2003下也是报IE出错的, 需要指定成具体的类型 ,比如Page.Response.ContentType = "Application/x-zip";
(我怀疑是系统设置的问题)to hchxxzx(NET?摸到一点门槛):
这个已经处理过了
to liuziran(CSDN第一帅哥(原倒立旋风转的青蛙)) :
这个不行,因为这个是个共通的,也就是说类型是不定的