1

I`m using vs2008. I added a webform with the following code:

<form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td>
                    upload image:
                </td>
                <td>
                    <asp:FileUpload ID="FUImage" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button ID="BtnUpload" runat="server" Text="Add" />
                </td>
            </tr>
        </table>
    </div>
    </form>

and in cs file is nothing, except default pageload handler that is empty.

I run webapplication, , choosing a jpg file to upload, clicking add new button and see internet explorer can`t show the page specified message.

3
  • 1
    Have you got friendly error messages on in IE? this sounds like a classic case of internet explorer hiding a more useful error message. For what its worth if I run that code for an app I get no problems. do you get the same problem if you don't select a file? Is the file you are choosing particularly big (there are configurable upload size limits)... Commented Jul 7, 2010 at 10:25
  • Thanks, Chris, it was filesize. Just didnt noticed file was too big. You gave me that tip, works fine now. If you post an answer Ill mark it as answer. Commented Jul 7, 2010 at 10:41
  • Glad to have helped. I've put an answer and got some doc references as well so the answer would be a bit more useful (sounds like you've sorted it but for future visitors to the question). Commented Jul 7, 2010 at 11:02

2 Answers 2

1

.NET can limit the size of requests to the server which obviously limits the maximum size of uploadable files.

http://msdn.microsoft.com/en-us/library/e1f13641.aspx explains the appropriate web.config attribute, in particular the maxRequestLength attribtue.

Sign up to request clarification or add additional context in comments.

Comments

0

Chris's answer is great but if anyone stumbles across this who is on IIS7, you'll need to add these lines instead:

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength=”500000000″ />
    </requestFiltering>
  </security>
<system.webServer>

This allows file uploads of up to 500 Meg. This takes effect immediately upon saving web.config. No need to restart IIS.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.