有没有办法忽略 2GB 文件上传的 maxRequestLength 限制?

Is there a way to ignore the maxRequestLength limit of 2GB file uploads?(有没有办法忽略 2GB 文件上传的 maxRequestLength 限制?)
本文介绍了有没有办法忽略 2GB 文件上传的 maxRequestLength 限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我将 maxRequestLength 设置为 2GB(最大值),这表示 ASP.NET 支持的最大请求大小:

Here's where I'm setting maxRequestLength to 2GB (the max value), which indicates the maximum request size supported by ASP.NET:

<system.web>
    <httpRuntime maxRequestLength="2097151" executionTimeout="3600"/>
    ...

这里我将 maxAllowedContentLength 设置为 4GB(最大值),它指定了 IIS 支持的请求中内容的最大长度

and here I'm setting the maxAllowedContentLength to 4GB (the max value), which specifies the maximum length of content in a request supported by IIS

<system.webServer>
    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="4294967295"/>
        </requestFiltering>
    </security>
    ...

我希望能够上传最大 4GB 的文件,但我受到 maxRequestLength 字段的限制.

I'd like to be able to upload files up to 4GB, but I'm limited by the maxRequestLength field.

我注意到这个第三方上传工具 (http://www.element-it.com/onlinehelp/webconfig.html) 有一个 ignoreHttpRuntimeMaxRequestLength 属性,它允许它上传文件最多4GB.

I noticed that this third party upload tool (http://www.element-it.com/onlinehelp/webconfig.html) has a ignoreHttpRuntimeMaxRequestLength property, which allows it to upload files up to 4GB.

有谁知道我是否可以像其他上传工具一样忽略 maxRequestLength 值?

Does anyone know if I can ignore the maxRequestLength value like this other upload tool does?

推荐答案

考虑MaxRequestLength 是一个 Int,目前无法解析高于 Int.Max 正确.

Considering the Type of MaxRequestLength is a Int, at the moment there is no way to parse a value higher than Int.Max correctly.

我听说他们可能会增加 IIS8,但微软目前还没有具体的消息.我在 .Net 4.5 中看到的唯一方法是使用 HttpRequest.GetBufferlessInputStream哪个

I heard they might be increasing IIS8 but nothing concrete from Microsoft as of yet. The only way I've seen in .Net 4.5 is to use HttpRequest.GetBufferlessInputStream which

获取可用于读取传入 HTTP 实体正文的 Stream 对象,可选择禁用 MaxRequestLength 属性中设置的请求长度限制.

Gets a Stream object that can be used to read the incoming HTTP entity body, optionally disabling the request-length limit that is set in the MaxRequestLength property.

这篇关于有没有办法忽略 2GB 文件上传的 maxRequestLength 限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)