【问题标题】:ASP.NET 4.0 C# File Upload multiple files using JQuery maxRequestLength needs to be over 4gbASP.NET 4.0 C#文件使用JQuery上传多个文件maxRequestLength需要超过4gb
【发布时间】:2014-05-28 18:29:35
【问题描述】:

我需要以某种方式使用 asp.net 文件上传器解决问题,以便它可以占用超过 4gb 的多个文件。有没有办法设置 web.config 或编写一个 C# 函数来绕过 ASP.Net 和 IIS 7 使用的文件空间的最大限制?我试图查看这个http://msdn.microsoft.com/en-us/library/hh195568.aspx,但我不知道如何使用该功能。请帮助,任何有关于解决方法的信息的人都会很棒,因为微软已经设置了限制,我猜肯定有一些东西可以绕过这些限制。

【问题讨论】:

标签: c# jquery asp.net .net http


【解决方案1】:

可惜maxRequestLengthInt32类型的变量(最大值为2147483647 - 0x7FFFFFFF

但是,如果您想为您的应用程序扩展 maxRequestLangh,那么您可以通过在 web.config 中为 httpRuntime 添加几个属性来实现:

<httpRuntime maxRequestLength="<size in bytes>" executionTimeout="<timeout in seconds>" />

这是一个示例(最大长度为 2 GB,超时时间约为 10 分钟):

<httpRuntime maxRequestLength="2147483647" executionTimeout="600" />

您还需要将security 部分添加到system.webServer

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2147483647" />
  </requestFiltering>
</security>

可能有用:

MSDN: maxAllowedContentLength

MSDN: httpRuntime Element

Large File Upload in IIS

Fixing File Upload Size Limit in IIS 7

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-10-16
    • 2012-04-06
    • 2011-12-27
    • 2021-09-09
    • 1970-01-01
    • 2011-07-27
    • 2014-05-04
    相关资源
    最近更新 更多