是否将超过2Gb的文件上载到IIS 8/ASP.NET 4.5?

是否将超过2Gb的文件上载到IIS 8/ASP.NET 4.5?,iis,upload,webdav,large-files,asp.net-4.5,Iis,Upload,Webdav,Large Files,Asp.net 4.5,我需要上传10Gb的文件到IIS在一块。据我所知,IIS 7.x/ASP.NET 4.0不支持通过2Gb上传(有些人说是4Gb) 它在IIS 8/ASP.NET 4.5中是否已修复?以下是我在4GB以下上传的方式(我也不知道如何突破此限制): 应用程序池是.NET4.0的经典模式(为什么没有4.5?)。web.config: <httpRuntime executionTimeout="2400" maxRequestLength="2099999999" /> ... <re

我需要上传10Gb的文件到IIS在一块。据我所知,IIS 7.x/ASP.NET 4.0不支持通过2Gb上传(有些人说是4Gb)


它在IIS 8/ASP.NET 4.5中是否已修复?

以下是我在4GB以下上传的方式(我也不知道如何突破此限制): 应用程序池是.NET4.0的经典模式(为什么没有4.5?)。web.config:

<httpRuntime executionTimeout="2400" maxRequestLength="2099999999" />
...
<requestLimits maxAllowedContentLength="4294967290"/>
日志显示,调用.NET4.5中的方法时没有异常。 但是这个链接说:“完成了。这个限制在4.5中被提高了。”


所以我只有一个问题:“怎么上传?”

怎么上传?使用PUT动词输入
input type=“file”
。使用带有“input type=“file”的POST multipart upload也可以,Chrome支持超过2Gb的上传。您上面提到的“requestLimits”元素有效地将IIS限制在4GB。我们(ASP.NET)原型化并验证了一个修补程序,该修补程序将使我们的“maxRequestLength”限制为64位整数而不是32位整数,但由于硬编码的IIS cap,我们从未签入修补程序,因为它不会非常有用。调用的GetBufferlessInputStream重载是使ASP.NET忽略“maxRequestLength”限制的唯一方法。我们正在与IIS团队讨论,试图在未来版本中取消硬编码上限。@Levi没有必要取消上限。把它拿走。此2Gb/4Gb限制使IIS/ASP.NET在我们的项目中无法使用。我们的客户需要通过web浏览器上传10Gb文件(是的,这是可能的)。Mb在owin自托管环境中是可能的?在过去7年中,有人在这方面取得了任何进展吗?
public override Stream InputStream
{
    get
    {
        object workerRequest = ((IServiceProvider)HttpContext.Current).GetService(typeof(HttpWorkerRequest));
        bool webDevServer = workerRequest != null &&
                            workerRequest.GetType().FullName == "Microsoft.VisualStudio.WebHost.Request";

        if (request.GetType().Assembly.GetName().Version.Major >= 4 && !webDevServer)
        {
            try // trying to set disableMaxRequestLength true for .NET 4.5
            {
                return (Stream)typeof(HttpRequest).GetMethod("GetBufferlessInputStream", BindingFlags.Public | BindingFlags.Instance, null, new[] { typeof(bool) }, null)
                                        .Invoke(request, new object[] { true });
            }
            catch (NullReferenceException)
            { // .NET 4.0 is not patched by adding method overload
                Log(DateTime.Now + ": Can not invoke .NET 4.5 method");
            }
            return (Stream) typeof (HttpRequest).GetMethod("GetBufferlessInputStream",
                                                           BindingFlags.Public | BindingFlags.Instance,
                                                           null, new Type[0], null)
                                                .Invoke(request, new object[0]);
        }
        return request.InputStream;
    }
}