Reputation: 1143
I'm working in MVC and I have view control for uploading document. My control is:
<%: Html.TextBoxFor(model => model.PutDoDatoteke, new { type="file"})%>
When I upload large file I get "The connection to the server was reset while the page was loading" error. I added
<httpRuntime executionTimeout="3600" maxRequestLength="157286400" />
<compilation debug="true" targetFramework="4.0">
to my web.config
file but i still get the same error. Is there any way to check file size on client side?
Upvotes: 3
Views: 4790
Reputation: 1143
This was solution for my problem : http://weblogs.asp.net/jeffwids/archive/2009/09/24/from-iis6-maxrequestlength-to-iis7-maxallowedcontentlengthfile-specifying-maximum-file-upload-size.aspx
Upvotes: 5
Reputation: 4791
Are you running this on your local machine or on a hoster? Most Hosters do not allow you to overwrite this section in the Web.Config?
What you can do it read this setting in the action method and pass it to the view in viewbag.
Upvotes: 0