Classic ASP – Upload file fails (>200kb)

A common problem (‘ASP 0104: 80004005’) is the file upload in a classic asp application. In the case of a file larger than 200kb, the upload fails due to the restriction named ‘maxRequestEntityAllowed’.
Here’s what the documentation says about ‘maxRequestEntityAllowed’ attribute:

Specifies the maximum number of bytes allowed in the entire body of an ASP request. This value is an integer in the range from 0 to 2147483647.
The default value is 200000.

Here’s a good example to see how many ways there are to do the same thing (here, max upload will be 10Mo):

      1. Set-WebConfigurationProperty cmdlet

      Import-Module WebAdministration
      Set-WebConfigurationProperty /system.webserver/asp/limits -name maxRequestEntityAllowed -value "10485760"
      
      2. APPCMD.EXE utility

      cmd /c "appcmd set config /section:asp /limits.maxRequestEntityAllowed:10485760"
      
      3. WMI

      $limit=Get-WMIObject -NameSpace root\MicrosoftIISv2 -Class IIsWebServerSetting -ComputerName localhost
      $limit.maxRequestEntityAllowed=10485760
      $limit.Put()
      

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top