Howtos / Articles

Increase the IIS 6 maximum request length for ASP pages

A default installation of IIS 6 on a Windows machine (Server or workstation) will limit the maximum request size for ASP scripts to 200kb. This may not cause any issues for most users, however when you start to integrate file uploads and similar functions, you may find that you encounter this issue. A common ASP error that occurs when the limit is set too low is “‘ASP 0104 : 80004005′ Operation not Allowed”. Luckily this limit is easy to change, and will be outlined in detail below.

This issue is cased by the “AspMaxRequestEntityAllowed” setting in the IIS metabase, which is stored in the “C:\Windows\System32\Inetsrv\MetaBase.xml” file. Please make sure you take a backup of this file before making any changes. Preferably take the backup after the web service has stopped, so you can be sure no other applications have the file currently open.

The first thing that needs to be done, is to stop the IIS Web server.

Click the “Start” button.

Browse to “Administrative Tools”.

Select the “Services” item.

The “Services” window should now appear. From here you can start and stop services that are set up on the machine.

Scroll all the way down to the bottom, and highlight the “World Wide Web Publishing Service” service.

Right click on the “World Wide Web Publishing Service” service, and select “Stop”.

The service will now stop. Depending on how many sites you have set up in IIS, the time it takes for this to stop may vary. It shouldn’t take too long.

Once the service has been stopped, you can modify the Metabase.xml file. This file contains all the IIS settings.

Open notepad, or your favorite text file editor, and select to open a file.

Type in, or browse to the following file:

c:\windows\system32\inetsrv\MetaBase.xml

If you choose to browse, you may find that you wont see the file, unless you change the “Files of type” option to “All Files (*.*’).

Use the find tool in Notepad, and search for the first occurance of:

AspMaxRequestEntityAllowed

You should find an entry like this:

The “204800″ option at the end of this line is the limit in bytes.

eg. 204800 / 1024 = 200kb

You need to change this value to whatever you need it to be. For this example I will set it to 2mb, as I don’t need it to be set too high.

2 x 1024 x 1024 = 2097152 bytes

You can use the above calculation, substituting the 2 for how many megabytes you wish to set the value to.

Update the value in Notepad to reflect your required size limit.

Save the file, and exit out of the text editor.

Go back to the services window from before. If you closed it, reopen it.

Right click on the “World Wide Web Publishing Service” service again, and click “Start”.

The service should now appear as “Started”.

If the service hasn’t started for some reason, check the Windows Event viewer.

Make sure you take a backup of the Metabase.xml file via windows explorer first before making any changes. Editing this file incorrectly will cause IIS not to start, so care should be taken with any modifications to this file.



Share this howto article!
  • Facebook
  • Twitter
  • Reddit
  • email

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>