Search code examples
azureasp.net-coreazure-web-rolesiis-8

Upload large file (>4MB) with asp.net 5.0 app hosted on windows azure


I want to upload a large file ( >4mb ) to my asp.net 5.0 app, everything works great on my computer using this config :

  <configuration>
    <system.webServer>
      <security>
        <requestFiltering>
          <requestLimits maxAllowedContentLength="2147483648" maxQueryString="2000">
          </requestLimits>
        </requestFiltering>
      </security>
      <handlers>
        <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
      </handlers>
      <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" forwardWindowsAuthToken="false" startupTimeLimit="3600"  />
    </system.webServer>
    <system.web>
      <httpRuntime maxRequestLength="102400000" />
    </system.web>
  </configuration>

But on azure ( Web Role ) it only works for files under 4MB.

I think that IIS is fine, it's Kestrel or the webListner which doesn't want to process the request ( I get "The specified CGI application encountered an error and the server terminated the process." ), I don't know if it possible to configure it too.


Solution

  • Sounds like another limit being hit. The system.web section is ineffective on ASP.NET 5 applications