lod*_*ddn 6 asp.net asp.net-mvc file-upload web-config filesize
我可以使用其他参数增加MVC Controller Action的ASP.NET请求的maxRequestLength吗?
我有一个带有ActionResult的UploadController,看起来像这样.
[HttpPost]
public ActionResult VideoUpload(int memberId)
{
var status= _docRepo.SaveDocument(DocumentType.Video, Request.Files, memberId);
return Json(new { success = true, status = status});
}
Run Code Online (Sandbox Code Playgroud)
文件可能非常大,我在web.config中增加了maxRequestLenght并且可以上传文件,但我担心安全问题.所以我尝试了这个并且它不起作用:
<location path="VideoUpload">
<system.web>
<httpRuntime maxRequestLength="1024000" executionTimeout="600" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1024000"/>
</requestFiltering>
</security>
</system.webServer>
</location>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?(上传方法使用swfupload)
| 归档时间: |
|
| 查看次数: |
2952 次 |
| 最近记录: |