开发者

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 p开发者_如何学Croblem here?


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


Use below in your Configuration file.

executionTimeout Time in Seconds maxRequestLength size in kbytes

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜