Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

File Size limit in FIleUpload control in ASP.Net

Posted on 2007-04-04
4
Medium Priority
?
733 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

618 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