?
Solved

File Size limit in FIleUpload control in ASP.Net

Posted on 2007-04-04
4
Medium Priority
?
731 Views
Last Modified: 2009-08-01
Hey,

I'm testing out my webapp on a localhost and I'm using the FileUpload Control. I'm able to upload small files but when I try to upload files that are few megabytes I get the following page in IE7
Internet Explorer cannot display the webpage
   
   Most likely causes:
You are not connected to the Internet.
The website is encountering problems.
There might be a typing error in the address.


or

The connection was reset

     

     
     
     

     
       
       

         

The connection to the server was reset while the page was loading.

       


       
       


    *   The site could be temporarily unavailable or too busy. Try again in a few
          moments.

    *   If you are unable to load any pages, check your computer's network
          connection.

    *   If your computer or network is protected by a firewall or proxy, make sure
          that Firefox is permitted to access the Web.

In Firefox, it worked fine when I uploaded a file that was 1.86mb's but failed when I tried to upload a file larger than 4mb (I didn't test between 2-4). Is there an option I'm missing in IIS or ASP.Net?
0
Comment
Question by:rebels_mascot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
jasco4617 earned 2000 total points
ID: 18851392
In your web.config file you can add the follow information:

<system.web>

      <httpRuntime maxRequestLength="11000" executionTimeout="120"  />

</system.web>


This will allow for something the input stream buffer size to be 11000 KB or about 10.75 MB and allow the request to take 120 seconds to complete which woudl give enough time for that about of data to be uploaded (hopefully).  you can tweak these settings to your need though.

Also, the default size for the input stream is 4MB which is why your uploads of larger thatn 4MB are not working.

- pat
0
 

Author Comment

by:rebels_mascot
ID: 18851423
Thanks for the quick reply Pat,

I just came across a post saying "To solve this problem go to C:\windows\system32\inetsvr and edit metabase.xml after stopping IIS." but when I went to that folder there was only a metabase.bin file.

Does <httpRuntime maxRequestLength="11000" executionTimeout="120"  /> overwrite the value set in the metabase file?
0
 

Author Comment

by:rebels_mascot
ID: 18851443
Thanks Pat that did the job.
0
 
LVL 4

Expert Comment

by:jasco4617
ID: 18851524
Not a problem.

As to your question about the metabase.xml file:  That file holds the configuration for IIS not ASP.NET and I am pretty unfamilar with it so i can not speak to which values needed edited in it to adjust the request length.  The web.config entry i gave you overrides the global IIS settings which are stored in the "C:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config" file.  I would suggest not editting it unless you tighten the security in it as it applies to all asp.net application running on that machines.  For instances like this where you are opening the security alittle you should do it on a per application (or even directory) basis.

Have fun!
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question