Aperture
Aperture

Reputation: 2427

FileUpload web control can't handle large jpg files(5MB)?

I'm testing a very simple aspx page on Visual Studio's own ASP.NET Development Server(the local server). On the webpage there is a FileUpload control which can upload jpg file up to 2MB without problems. On uploading bigger files, the browser immidiately show "The web page cannot be displayed". It does not show any exception which really puzzles me. "The web page cannot be displayed" is normally caused by network problem, but in this case it's a local server and it can handle smaller jpg file fine. Whta's the problem here?

Upvotes: 2

Views: 1267

Answers (2)

Nash
Nash

Reputation: 531

Use below in your Configuration file.

executionTimeout Time in Seconds maxRequestLength size in kbytes

Upvotes: 1

Claudio Redi
Claudio Redi

Reputation: 68400

The max upload size is 4MB by default. You can change it on web.config

<system.web>
    <httpRuntime maxRequestLength="size" executionTimeout="seconds"/>
</system.web>

Take into account that uploading large files without any feedback to the user could be not very user-friendly. You should analyze carefully how to implement the interface.

Here you have the complete reference for httpRuntime Element

http://msdn.microsoft.com/en-us/library/e1f13641%28VS.71%29.aspx

Upvotes: 4

Related Questions