且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

下载.swf文件时的“保存"对话框

更新时间:2022-12-09 12:52:10

我很高兴找到解决方案.顺便说一句,这可能会带来安全风险:
I''m glad you found a solution. By the way, this may be a security risk:
wajans写道:

System.IO.FileInfo targetfile = new System.IO.FileInfo(anchor.HRef);

System.IO.FileInfo targetfile = new System.IO.FileInfo(anchor.HRef);


如果有人入侵HTTP请求,他们可能会发回任意文件名(这将使他们可以访问您网站上几乎所有的文件,例如web.config).


If somebody hacks an HTTP request, they can potentially send back an arbitrary file name (which would give them access to pretty much any file on your website, such as the web.config).


您可以尝试:

You could try:

Response.ContentType "application/octet-stream"



祝你好运!



Good luck!


如果您不告诉我们很多不起作用"的信息,我们将为您提供帮助.

什么不起作用?您是否尝试在调试器下运行代码?
We can''t help you if you don''t tell us more than "it''s not working".

WHAT isn''t working? Did you try running the code under the debugger?