【问题标题】:Asp.Net MVC Large Files Upload using XMLHTTPRequest使用 XMLHTTPRequest 上传 Asp.Net MVC 大文件
【发布时间】: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


    【解决方案1】:

    尝试从 xhr.open 函数中移除 async 'true'

    【讨论】:

      猜你喜欢
      • 2014-05-13
      • 2011-07-08
      • 1970-01-01
      • 2010-10-16
      • 2011-06-18
      • 2014-08-06
      • 2010-11-05
      • 1970-01-01
      • 2014-01-10
      相关资源
      最近更新 更多