【发布时间】:2016-07-08 17:01:41
【问题描述】:
我正在使用 XMLHttpRequest 将多个上传到 ASP.NET MVC 控制器。我将多个文件附加到 FormData 并在一个 XMLHttpRequest 中发送它们,并且我正在使用 IISExpress。 通过在谷歌上搜索,我将 web.config 更改如下:
<httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="3600" requestLengthDiskThreshold="2147483647"/>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483644"></jsonSerialization>
</webServices>
</scripting>
</system.web.extensions>
我还尝试在打开 XMLHttpRequest 时使用“PUT”而不是“POST”,如下所示:
xhr.open("PUT", myForm.action, true);
但我仍然无法提出超过 30 MB 的请求!我真的需要完成这项工作,所以我希望有人能尽快帮助我。
【问题讨论】:
标签: asp.net-mvc-4 xmlhttprequest