【问题标题】:Bypass 2GB Upload Limit IIS绕过 2GB 上传限制 IIS
【发布时间】:2016-09-17 19:51:25
【问题描述】:

IIS (7) 阻止我从客户端(asp.net 代码 - .NET 3.5)上传到我的服务器(共享点),因为该文件大于 2GB。根据我在网络上的研究,这似乎是极限。

那么我们怎样才能绕过这个限制呢?

客户端代码:

string urlFile = "xxxxx"

Stream input = Telechargeur.FileContent
Stream output = new FileStream(urlFile,FileMode.OpenOrCreate)

byte[] buffer = new byte[1024*1024*5]
int nbRead = -1

while((nbRead = input.Read(buffer,0,buffer.Length))>0)
{
  output.Write(buffer,0,nbRead);
  output.Flush();

}

input.Close();
output.Close();

服务器代码:

string urlFile = "xxx"

Stream input = context.Request.InputStream; Stream output =  new FileStream(urlFile,FileMode.OpenOrCreate)

byte[] buffer = new byte[1024*1024*5]
    int nbRead = -1

    while((nbRead = input.Read(buffer,0,buffer.Length))>0)
    {
      output.Write(buffer,0,nbRead);
      output.Flush();

    }

    input.Close();
    output.Close();

非常感谢

【问题讨论】:

    标签: c# asp.net .net iis sharepoint-2010


    【解决方案1】:

    由于您没有说明您使用的是什么版本的 SharePoint,我假设是 2013 年。请参阅Technet article on Software boundaries and limits for SharePoint 2013 这是 SharePoint 设计中的架构限制,无法绕过。您在这里试图颠覆的实际上是文章中用于定义“边界”的场景:

    Boundaries are absolute limits that cannot be exceeded by design. It is
    important to understand these limits to ensure that you do not make 
    incorrect assumptions when you design your farm.
    
    An example of a boundary is the 2 GB document size limit; you cannot 
    configure SharePoint Server 2013 to store documents that are larger than 2 
    GB. This is a built-in absolute value, and cannot be exceeded by design.  
    

    即使您可以说服 SharePoint 让您绕过限制,这也是一个非常糟糕的主意,因为这会使您的服务器场处于不受支持的状态。这意味着,当您因一些奇怪的问题而寻求支持并且您所做的事情被发现时,您将被告知在您正确重建该农场之前您将无法获得该农场的支持。

    我还想到RBS 可能会让你绕过这个限制。对不起,那也不行:

    【讨论】:

    • 感谢您的回复。但就我而言,我将文件上传到服务器(目录中)而不是内容数据库中。所以,对我来说,问题是 IIS 而不是 SharePoint。有什么想法吗?
    • 我对您的解决方案的架构有点困惑。您说您要上传到 SharePoint 服务器,而不是上传到 SharePoint。我不怀疑这就是您认为自己正在做的事情,但我怀疑 SharePoint 正在拦截请求并拒绝您的大型上传。
    • 您说您要上传到 SharePoint 服务器,而不是上传到 SharePoint。我怀疑 SharePoint 正在拦截请求并拒绝您的大型上传。您是说您有一个用于 SharePoint 的虚拟目录和一个用于此任务的不同目录吗?如果是这种情况,那么它可能会起作用,因为 SharePoint 内部 WEBDAV 实现不会拦截您的请求。如果您假设您可以利用 SharePoint WEBDAV 功能,那您就错了。我会检查 IIS 日志,看看谁在处理您的请求。
    • 你完全正确,我的错。我只有一个虚拟目录。我想说的是,我不是在内容数据库中上传,而是将文件放在文件系统上。我将尝试似乎可以给我解决方案的整洁上传 API...我会返回
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-27
    • 1970-01-01
    • 2012-04-11
    • 2012-02-17
    • 1970-01-01
    • 2011-10-11
    • 1970-01-01
    相关资源
    最近更新 更多