Posts Tagged ‘IIS 6’

Upload using MetaBuilders.FileUp.wsc script with file size greater than 200 KB

November 29th, 2006

Problem

Upload using MetaBuilders.FileUp.wsc script with file size greater than 200 KB
Keywords:

Platform

Windows Server 2003 SP2 (Software: IIS 6.0, ASP)

Symptoms

Everytime I try to upload a file it either does nothing or in debug mode it gives an invalid object error message. It also did not read in any of my form details from posting. This upload application was previously working for a while so it seemed like it suddenly broke.

Fix

After staring at it long enough I figured out that no data was being passed between the form page and the processing page that called out to the script. I also went to the following page and downloaded the sample files on page 2:

http://www.4guysfromrolla.com/webtech/012401-1.shtml

After downloading the example and putting it on the server and trying a couple times, I decided to try a different file. The new file worked. I hypothesized that it was because of file size as the second file I tried was only a couple KB while the first file was 250KB. I looked through the MetaBuilders.FileUp.wsc script to find if there was a file size limitation that could be modified. After that I figured that since I was using the post method to submit the form, there might be a size limit on the post as the post method encapsulates the file being uploaded. I searched on the internet and found the following site:

http://msdn2.microsoft.com/en-gb/library/ms524996.aspx

Under the heading “Client Requests Error-out or Time-out” the following line is stated:

“Limits on posts: The AspMaxRequestEntityAllowed metabase property enforces a maximum ASP post size of 204,800 bytes, with each individual field limited to 100 KB. There was no limit to posts prior to IIS 6.0.”

This property is located in the IIS Metabase. You have to go in and edit it to increase the size you want as your maximum. To edit the Metabase follow these instructions NOTE: backup the metabase before making any changes!!!:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/ 1d1e5de4-fd63-40cd-bc5d-c20521548eed.mspx?mfr=true

Summarized: Procedures To enable the edit-while running feature of the metabase by using IIS Manager<

1. In IIS Manager, right-click the local computer, and then click Properties.

2. Select the Enable Direct Metabase Edit check box, and then click OK.

To modify the IIS metabase

1. Open the Metabase.xml file in a text editor. The default path to this file is systemroot\system32\inetserv\metabase.xml

2. Modify the metabase properties that you wish to change in the Metabase.xml file.

3. Save the changes to the file, and close the text editor. Most changes to metabase properties are automatically recognized by IIS; in some cases, you must restart IIS for the metabase property changes to go into effect.

To disable the Edit-while running feature of the metabase by using IIS Manager

1. In IIS Manager, right-click the local computer, and then click Properties.

2.Clear the Enable Direct Metabase Edit check box, and then click OK. Once you open the Metabase do a search for AspMaxRequestEntityAllowed and modify the value. The MetaBuilders.Fileup.wsc script uses significant system resources because of the way it implements the upload. A 1 MB could take upwards of 5 – 10 minutes based on the connection. I would not enter a value greater than 1 MB as it will eat up large amounts of your server system resources. Once you are done modifying the value, save the file and restart IIS. You should be able to upload files larger than 200KB.

Tags: , ,
Posted in Uncategorized | Comments (0)