0

I know this question has been asked in other threads, but none of the solutions provided could fix my problem.

When I upload a file greater than ~4MB (i.e. bigger than default), I get the "Internet Explorer cannot display the webpage" error. (Files smaller has no problems).

Here's what I've done so far:

1) Edited webconfig:

<httpRuntime maxRequestLength="20480" executionTimeout="3600" enable="true"/>
<customErrors mode="Off"></customErrors>

AND

<requestLimits maxAllowedContentLength="20000000000" />

2) Updated hosts file (C:\Windows\System32\drivers\etc\hosts) to remove line:

:: 1 localhost

3) Tested on IE, Chrome, and Firefox (all have the same issues).

4) Tried using IE's developer tools but not quite sure what to look for.

Would really really appreciate any advice/guidance on this! I've spent almost 2 days on this and still cannot figure it out. I gather it must be the file size issue (since I have load smaller files...)

THANKS so much!

viv_acious
  • 2,429
  • 9
  • 34
  • 55

4 Answers4

0

Assuming that you have file upload control as follows:

<asp:FileUpload ID="flUpImg" runat="server"/>

when uploading is done you usually upload files to the server by clicking a button. In that button click event check for

flUpImg.PostedFile.ContentLength

let xxxx be the value returned. Note it down and stop debugging. Go to web.config file and edit the following tag as

<httpRuntime maxRequestLength="value greater than xxxx"/>

where xxxx is the size of the uploaded files.

navule
  • 3,212
  • 2
  • 36
  • 54
0

Two more things to look at:

1) Are you running UrlScan or some other IIS add-in? You can check through the IIS console by choosing your web-site and clicking ISAPI Filters. If so, check whether it too has an upload size limit that you need to override: e.g., C:\Windows\System32\inetsrv\urlscan\urlscan.ini, [RequestLimits], MaxAllowedContentLength=1073741824.

2) Check your global .config files: machine.config and root-level web.config in e.g. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config (for 64-bit applications running .NET 4) for <system.web /> and applicationHost.config in C:\Windows\System32\inetsrv\config for <system.webServer /> in case there are any non-standard settings in there such as allowDefinition="MachineOnly" or allowOverride="false". I suspect this isn't the problem, as you would probably see some sort of message on the screen or in the application event log if it were; something else to tick off your list, though.

Ed Graham
  • 4,306
  • 3
  • 30
  • 30
0

I was facing the same issue which got resolved by adding below in web.config under system.web.

<httpRuntime maxRequestLength="20480" executionTimeout="3600" enable="true"/>
Tapas
  • 1
0

The key is the maxRequestLength="20480" inside your <httpRuntime> tag. It's failing because the page is rejecting the file you're testing, which is evidently larger than 20MB. If you check the file you're testing you'll probably notice this.

Try setting this figure a lot higher and you will get some success!:

<httpRuntime maxRequestLength="51200" executionTimeout="3600" enable="true"/>
Josh Harris
  • 446
  • 4
  • 8