Cipiripi
Cipiripi

Reputation: 1143

MVC - problem when uploading large files

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

Answers (2)

Matthew M. Osborn
Matthew M. Osborn

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

Related Questions