首页 文章

404错误 - 上载文件大小超过30 MB

提问于
浏览
0

在我们的Web API中,我们无法上传超过30MB的fize大小 . 我们曾经得到404错误,如“ 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

通过谷歌搜索和看到各种帖子,我厌倦了我的配置文件中的以下更改:

Web.Config:

<system.web>
     <httpRuntime maxRequestLength="204800" timeout="7200" />
</system.web>
<requestFiltering>
     <requestLimits maxAllowedContentLength="209715200" maxQueryString="2097151" maxUrl="10999"/>
</requestFiltering>

但是,我无法上传超过30MB大小的文件 . 但是相同的代码可以正常上传低于30 MB的文件 .

我在这里错过了什么?

2 回答

  • 0

    1.)打开IIS管理器 .

    2.)选择要配置的网站 .

    3.)确保您根据经理底部的按钮进入功能视图 .

    4.)选择“请求过滤”,然后双击该图标将其打开 . 将显示“请求筛选”窗格 .

    5.)在屏幕右侧的“操作”窗格中,单击“编辑功能设置...”链接 . 将显示“编辑请求筛选设置”窗口 .

    6.)在“请求限制”部分中,输入相应的“允许的最大内容长度(字节)”,然后单击“确定”按钮 . 重启IIS .

    这对我有用:)

  • 0

    你能改变web.config使用 system.webServersecurity 吗?

    <configuration>
        <system.web>
            <httpRuntime maxRequestLength="204800" />
        </system.web>
        <system.webServer>
            <security>
                <requestFiltering>
                    <requestLimits maxAllowedContentLength="209715200" />
                </requestFiltering>
            </security>
        </system.webServer>
    </configuration>
    

相关问题