Can I increase maxRequestLength of ASP.NET request for MVC Controller Action with additional parameters?
I have a UploadController with a ActionResult looking somthing like this.
[HttpPost]
public ActionResult VideoUpload(int memberId)
{
var status= _docRepo.SaveDocument(DocumentType.Video, Request.Files, memberId);
return Json(new { success = true, status = status});
}
The files can be very large, i have increaset maxRequestLenght in web.config and can upload the files, but im worried about the security issue. So i tried this and its not working:
<location path="VideoUpload">
<system.web>
<httpRuntime maxRequestLength="1024000" executionTimeout="600" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1024000"/>
</requestFiltering>
</security>
</system.webServer>
</location>
Any ideas? (the upload method is using swfupload)
MVC Controller Actions do not use the location
section of the Web.config. See this answer for more information. You can increase it programmatically via the MaxRequestLength property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With