Response.WriteFile()不触发 [英] Response.WriteFile() is not tiggering
本文介绍了Response.WriteFile()不触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人
我正在尝试通过使用以下代码来压缩文件.它可以在Windows XP中正常运行,但不能在Windows 7操作系统中正常运行.
我正在使用Visual Studio 2003
Dear All
I am trying to down the file by using the below code. It is working fing in Windows XP but it does not working in Windows 7 Operating System.
i am using visual studio 2003
fo = New IO.FileInfo(localfname)
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + "Domestic-Outgoing.ini")
Response.AddHeader("Content-Length", fo.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.WriteFile(fo.FullName)
Response.End()
Response.Clear()
请指导我,我仅使用Visual Studio 2003
在此先感谢
Please guide me i am using Visual Studio 2003 only
Thanks in Advance
推荐答案
尝试使用
Response.AddHeader("Content-Disposition", "inline; filename = \"" + doc.Name+"\"");
.在文件名之前和之后添加反斜杠.
. Add to backslashes before and after the file name.
这篇关于Response.WriteFile()不触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文