1

ユーザーがサーバーにファイルをアップロードできるページがあります。私は指定しました

    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="512000"></requestLimits>
        </requestFiltering>
    </security>

Web.configにありますが、リクエストが大きすぎるというエラーが表示されます。私は1つの解決策を見つけました-システムファイルapplicationHost.configを変更します。設定しました

<requestLimits maxAllowedContentLength="512000000">

そしてそれは私の問題を解決しました。ただし、Devサーバーでこのファイルを変更することはできません。私はいくつかの解決策を見つけました、例えば使用

<clear/>

また

<remove name="..."> 

私のWeb.configで

    <security>
        <requestFiltering>
            <clear/>
            <requestLimits maxAllowedContentLength="512000"></requestLimits>
        </requestFiltering>
    </security>

でも今は

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
4

1 に答える 1

6

設定する必要があると思います

<configuration>
  <system.web>
    <httpRuntime maxRequestLength="2097151" />
  </system.web>
</configuration>

代わりは。これは2GBです。これが最大だと思います。

于 2013-03-22T13:43:22.600 に答える