UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  eUKhost's Official Web Hosting Forum > Technical Support > Tutorials / How to?

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-11-2009, 23:19
Rock's Avatar
Technical Support (eUKhost.com)
 
Join Date: Oct 2006
Location: localhost
Posts: 3,356
Send a message via MSN to Rock Send a message via Skype™ to Rock
Smile Increase File Upload Size in ASP & ASP.NET

Windows Server 2003 (IIS 6.0):

When you use an Active Server Pages (ASP) request to upload a large file to a computer where Microsoft IIS 5.0, 5.1, or 6.0 is installed, the upload may fail.

This issue occurs if a Content-Length header is present & if the Content-Length header specifies an amount of data that is larger than the value of the AspMaxRequestEntityAllowed property in the IIS metabase. The default value for the AspMaxRequestEntityAllowed property is 204,800 bytes [200Kb].

To increase this value, modify the value in the AspMaxRequestEntityAllowed property to set the maximum number of bytes that are permitted in the entity body of an ASP request. To do this, follow these steps:

Editing the Metabase.xml directly [Not Recommended]:

Warning : If you edit the metabase.xml incorrectly, you can cause serious problems that may require you to reinstall any product that uses the metabase. It's advised to backup the metabase before editing it..
  1. Stop the web server using iisreset /stop
  2. Opening the Metabase file (%systemroot$/system32/inetsrv/metabase.xml) in a text editor [Notepad/Wordpad].
  3. Search for the term ASPMaxRequestEntityAllowed node.
  4. Changing it's value to the desired/required one [104857600 Bytes for 100MB].

Using the inbuilt/shipped scripts [Recommended method]:

You can run the following from a command prompt while in the C:\Inetpub\AdminScripts directory instead of editing the Metabase.xml file directly as mentioned in above method.

1. At a command prompt, type the following command, & then press ENTER:
Quote:
cd C:
cd C:\Inetpub\AdminScripts
2. At a command prompt, type the following command, & then press ENTER to check the current upload limit:

cscript adsutil.vbs get w3svc/ASPMaxRequestEntityAllowed

Quote:
C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/ASPMaxRequestEntityAllowed

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

ASPMaxRequestEntityAllowed : (INTEGER) 204800
It displays the current/present value that is set to 204800 ie: 200KB.

3. Now to change the value to any higher one, run the following command:

cscript adsutil.vbs set w3svc/ASPMaxRequestEntityAllowed size

In this command, size is a placeholder for the largest file size upload that you want to allow. The maximum value is 1,073,741,824 bytes. Set this value to the lowest possible value that allows for the functionality that you want.

To change the value to 100MB, run the following command:cscript adsutil.vbs set w3svc/AspMaxRequestEntityAllowed 104857600
Quote:
C:\Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/AspMaxRequestEntityAllowed 104857600
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

AspMaxRequestEntityAllowed : (INTEGER) 104857600
4. Run iisreset /restart to restart the web services & for the changes to come into effect.

You can confirm the changes by checking the ASPMaxRequestEntityAllowed using the GET command [as in step 2]:
Quote:
C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/ASPMaxRequestEntityAllowed
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

ASPMaxRequestEntityAllowed : (INTEGER) 104857600
The example above updates the metabase.xml file & sets the maximum uploadable value to 100MB. You're done

More detailed info on this: The AspMaxRequestEntityAllowed property specifies the maximum number of bytes that are permitted in the entity body of an ASP request. If a Content-Length header is present & if the Content-Length header specifies an amount of data that is larger than the value of the AspMaxRequestEntityAllowed property, IIS returns a 403 error response. The AspMaxRequestEntityAllowed property applies only to PUT requests & to POST requests. The AspMaxRequestEntityAllowed property does not apply to GET requests. Because this metabase property applies only to ASP, other Internet Server API (ISAPI) extensions are not affected.

The AspMaxRequestEntityAllowed property is related in function to the MaxRequestEntityAllowed property. However, the AspMaxRequestEntityAllowed property is specific to ASP requests. You can set the MaxRequestEntityAllowed property to 1 megabyte (MB) at the World Wide Web Publishing Service (WWW Service) level. Then, you can set the AspMaxRequestEntityAllowed property to a smaller value if you know that your specific ASP applications handle a smaller amount of data.


Windows Vista or Windows Server 2008 (IIS 7.0):

With Windows Vista & Windows Server 2008, the way is a bit different. To achieve the same setting, it can now be done via the IIS Administrative tool. To change do the following:

* Open IIS Manager from the Administrative Tools.
* Select the Server from the tree structure on the left hand side
* Double click on ASP in the right pane.

* You will see a list of properties, Expand the Limits Properties & you will see Maximum Request Entity Body Limit. Set the value here in bytes to the upload limit you wish/require.

* Click Apply & you're done

There is a similar limit imposed in all flavours of ASP.net. This can be configured in the machine.config file of the machine or in the web.config for the application. Adding the following under the <system.web> tag in the will increase the ASP.net maximum upload to 10MB in this example.
Quote:
<system.web>
<httpRuntime maxRequestLength="102400" />
</system.web>
Happy uploading..
__________________

Rock _a.k.a._ Jack
Windows Hosting || Windows Reseller Hosting
Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
Follow eUKhost on Twitter || Join eUKhost Community on Facebook

For complaints, grievances or suggestions kindly email our FeedBack Dept.
Proper action will be taken accordingly & instantaneously!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT. The time now is 01:08.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
UK Web Hosting by eUKHosting 3.1.0
UK Web Hosting by eUKHosting 3.1.0
Copyright © 2001-2012, eUKhost LTD. All rights reserved.

 


UK VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

VoIP Dedicated Servers
Asterisk, Trixbox Dedicated Servers

Business Web Hosting
100% uptime Hosting

UK Cpanel Hosting
cPanel Shared Hosting

Domain Hosting
Cheap Domains & Hosting Plans

UK Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

ColdFusion Hosting
ColdFusion Web Hosting
 
 

Android and Apple App


knowledgebase articles
eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting

Joomla Hosting
Joomla Web Hosting

Mambo Hosting
Mambo Web Hosting

Magento Hosting
Magento Web Hosting

Wordpress Hosting
Wordpress Web Hosting

 

Web Hosting Affiliate Program
 

popular blog categories

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles