如何在 IIS 7 上启用经典 ASP 中的大文件上传? [英] How do I enable upload of large files in classic ASP on IIS 7?

查看:18
本文介绍了如何在 IIS 7 上启用经典 ASP 中的大文件上传?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我不得不让一个旧的 ASP 应用程序在 W2K8 服务器上的 IIS 7.5 中运行.几乎一切正常,除了我似乎无法让它接受大于~200kB 的上传.我确实找到了一个设置,根据我的理解应该是诀窍,在 applicationHost.config 中,我将最大请求大小设置为 100 MB,如下所示:

<location path="TheNameOfMySite"><system.webServer><安全><请求过滤><requestLimits maxAllowedContentLength="104857600"/></requestFiltering></安全></system.webServer></位置>

不幸的是,这似乎什么也没做,它仍然拒绝接受任何大于约 200 KB 的文件,并且在日志文件中它给出了以下错误消息:

<上一页>ASP_0104_:_80004005|Operation_not_Allowed

谷歌搜索指出增加 maxAllowedContentLength 就像我在上面所做的那样.所以我的想法很新鲜,但相信聪明的stackoverflow人群可以在比我写这个问题的时间更短的时间内解决这个问题.

解决方案

maxAllowedContentLength 控制允许在响应中发送多少数据.但是,您想控制请求中可以接受的数量.这由配置文件 asp 部分中 limits 元素的 maxRequestEntityAllowed 属性处理.一个示例可能如下所示:-

<asp><cache diskTemplateCacheDirectory="%SystemDrive%inetpub	empASP 编译模板"/><限制 scriptTimeout="00:02:00"queueConnectionTestTime="00:00:05"requestQueueMax="1000"maxRequestEntityAllowed="104857600"/></asp>

您可以在 ASP 功能的属性网格中的限制属性"类别下的 IIS7 管理器中进行配置.或者,您可以使用命令行:-

appcmd 设置配置/section:asp/limits.maxRequestEntityAllowed:104857600

请注意,扩展此值会增加 DOS 攻击的窗口,在该窗口中,攻击者会将大量内容发送到服务器,因此不要试图将其扩展至超出您真正需要的范围.

Recently I had to get an old ASP application working in IIS 7.5 on a W2K8 server. Almost everything works fine, except that I can't seem to get it to accept uploads larger than ~200kB. I did find a setting, that from what I can understand should to the trick, in the applicationHost.config, I set the max request size to 100 MB like this:

<location path="TheNameOfMySite">
    <system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="104857600" />
            </requestFiltering>
        </security>
    </system.webServer>
</location>

Unfortunately, this seems to do nothing at all, it still refuses to accept any files larger than about 200 KB, and in the log file it gives this error message:

ASP_0104_:_80004005|Operation_not_Allowed

Googling that points to increasing the maxAllowedContentLength as I have done above. So I'm fresh out of ideas, but confident that the clever stackoverflow crowd can solve this in less time than it took for me to write this question.

解决方案

The maxAllowedContentLength controls how much data is allowed to be sent in a response. However you want to control how much can be accepted in a request. This is handled by the maxRequestEntityAllowed attribute of the limits element in the asp section of the config file. An example might look like:-

<system.webServer>
  <asp>
     <cache diskTemplateCacheDirectory="%SystemDrive%inetpub	empASP Compiled Templates" />
     <limits scriptTimeout="00:02:00"
        queueConnectionTestTime="00:00:05"
        requestQueueMax="1000"
        maxRequestEntityAllowed="104857600"
        />
  </asp>

You can configure this in the IIS7 manager under the "Limit Properties" category in the property grid for the ASP feature. Alternatively you can use a command line:-

appcmd set config /section:asp /limits.maxRequestEntityAllowed:104857600

Note that extending this value increase the window for DOS attack where the attacker sends large content to the server so don't be tempted to extend this beyond what you really need.

这篇关于如何在 IIS 7 上启用经典 ASP 中的大文件上传?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆