473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Setting maxrequestlength in the page

I'm running into the notorious 4MB upload limit. I see where one answer is
to set a higher limit to the httpRunTime MaxRequestLength setting in
web.config. However this affects the whole application, and if I'm going to
increase this limit, I'd rather only increase it for the one page that needs
it, the one with the FileUpload controls.

So it was great to see the .NET Framework 2.0 now allegedly supports this in
the page. So I tried it (the application is set to the 2.0 Framework,, and
I'm using VS2005). I removed the setting in web.config so that all pages
would default to the 4MB limit. Then, on my page with the FileUpload
controls, I added the following code:

<%@ import Namespace="System.Web.Configuration" %>

Dim httpConfig As HttpRuntimeSection = New HttpRuntimeSection

Sub Page_Load()
httpConfig.MaxRequestLength = 8192
... other code to handle the uploading ...
End Sub

However, it doesn't seem to work. I still get the "Maximum request length
exceeded" errors when I upload a file larger than 4MB.

Am I implementing this properly, or am I missing something?

-Robert-

Sep 21 '06 #1
0 1616

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Stephen | last post by:
Is it possible to set httpRuntime.maxRequestLength to limit the suze of an uploaded file dynamically or is it only possible statically in Web.config file (or system.config) ie I would like to...
1
by: Brad | last post by:
I'd like to display the maxRequestLength value on a page, so users could see what the aprox current file upload size limit is. Can the value of maxRequestLength be determined at runtime? Can it...
2
by: Peter Row | last post by:
Hi, To allow users to upload files larger than 4MB in size I added: <httpRuntime maxRequestLength="102400" executionTimeout="600" /> ...to my web.config file. Fair enough this works fine....
1
by: sam | last post by:
Hi, I have seen many posts about this problem and no resolution. I have set the maxRequestLength to 200K as I don't want anyone uploading files to the server greater than this size. I have...
1
by: toto | last post by:
Example: <configuration> <system.web> <httpRuntime maxRequestLength="2048" /> </system.web> </configuration> I need to kno in my code the value of key maxRequestLength. Thanks in advance.
5
by: Matt Chubb | last post by:
I've searched the forums and the net and have not found a solution to this upload problem, any suggestions/help in this matter would be greatly appreciated. I'm trying to trap and display an...
1
by: Andy Stephens | last post by:
Hi all I'm developing a site where visitors can upload images (using the html file input control). As most webhosting companies set a monthly bandwidth limit I want to try and limit the size of...
4
by: UJ | last post by:
I have a page where the user can upload a video file. As you can guess, this may take a while. Is there a way I can change the session timeout for just this one page? I would also want to change...
2
by: Eric | last post by:
Hi All, I am working with an ASP.NET website with .NET 1.1. I want to increase the maxRequestLength value for *only* a single page (therefore, I can't set the new value in machine.config or...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.