locked
How do I enable upload of large files in classic ASP on IIS? RRS feed

  • Question

  • User387006649 posted

    I have an upload system in ASP Classic. I can upload up to 200KB without problems, but when I try a larger size the error occurs:

     

    Request object error 'ASP 0104 : 80004005'

    Operation not Allowed

    /admin/freeaspupload.asp, line 101

    I saw that I need to adjust the web.config file on the hosting server (godaddy), so I put it like this, but even then the error continues.

     

    <?xml version="1.0" encoding="UTF-8"?>

    <configuration>

    <system.web>

    <customErrors mode="Off"/>  

    <httpRuntime maxRequestLength="2147483647"/>

    <sessionState timeout="1600"  />

    </system.web>

      

    <system.webServer>

                    <httpRedirect enabled="false" destination="" exactDestination="true" httpResponseStatus="Permanent" />

                    <httpErrors errorMode="Detailed">

    <remove statusCode="403" subStatusCode="-1" />

    <remove statusCode="404" subStatusCode="-1" />

    </httpErrors>

                    <security>

    <requestFiltering>

                                   <requestLimits maxAllowedContentLength="2147483647"/>

    </requestFiltering>

    </security>

    </system.webServer>

    </configuration>

     

    Someone to help me please?

    Wednesday, January 27, 2021 1:11 AM

All replies

  • User1771714573 posted

    Hi tosta,

    MaxAllowedContentLength controls how much data is allowed to be sent in a response. MaxRequestEntityAllowed control how much can be accepted in a request.

    You can set value of MaxRequestEntityAllowed to fix the issue.

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

    However, extending this value may increase the window for DOS attack. Just extend it to what you really need.

    Best regards,

    Brucz

    Wednesday, January 27, 2021 8:47 AM
  • User387006649 posted

    I tried to use the code above as I said, but in different ways it is not accepted.

    Thursday, January 28, 2021 11:34 PM
  • User1771714573 posted

    Hi tosta,

    I don't see MaxRequestEntityAllowed in the web.config you post. You have set maxAllowedContentLength but it is different with MaxRequestEntityAllowed.

    In IIS, the default value of MaxRequestEntityAllowed is 200000, about 200KB. This is exactly the size of the file you cannot upload.

    Best regards,

    Brucz

    Friday, January 29, 2021 7:50 AM