w3wp 可以处理下载文件
我设置了iis来使用“asp.net 2.0”的isapi过滤器来处理.exe,以启用动态URL替换。 为此,我在 iis 中设置了扩展,并将以下行添加到 web.config 中。到目前为止效果很好。
问题在于,w3wp 进程在这些文件上有多个句柄。很可能是因为有人正在下载它们。
有没有办法告诉 iis/asp.net 不要在文件上放置独占句柄?即使网站正在运行,我也想替换它们。只要 asp.net 不处理这些文件,此操作就有效。
I set up iis to handle .exe with "asp.net 2.0"s isapi filter to enable dynamic url replacement.
For this I setup the extension in iis and added the following line to web.config. Works fine so far.
<add path="*.exe" verb="*" type="System.Web.StaticFileHandler" />
the problem is that form that point w3wp process has several handles on these files. Most likely because someone is downloading them at the moment.
Is there a way to tell iis/asp.net not to put a exclusive handle on the file? I want to replace them even if the site is running. This works as long as asp.net does not handle these files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为没有办法做到这一点。您告诉 IIS 处理此文件类型,因此服务器具有一定的排他性。在我看来,此行为是有意为之的,因为它可以防止生产环境中的文件损坏。
也许它有助于将请求限制为某些选定的 HTTP 动词(POST/GET),但我没有看到任何其他选项。
另一个问题是:为什么要替换用户当前下载的文件?它会损坏他的下载,迫使他重新开始。
I don't think there is a way to do this. You are telling IIS to handle this filetype, so the server is assuming a certain exclusivity. This behavior is intended IMO, because it prevents corrupted files in production environment.
Maybe it helps to limit the requests to some selected HTTP verbs (POST/GET), but i don't see any other options.
And the other question is: why do you want to replace a file, that is currently downloaded by a user? It will corrupt his download, forcing him to start all over again.