2016-09-17 83 views
0

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

那么我们该如何绕过这个限制呢?

客户端代码:

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(); 

Server代码:

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(); 

非常感谢

回答

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可能会让你绕过这个限制。对不起,这不会这样做:

enter image description here

+0

感谢您的回复。但就我而言,我将文件上传到服务器(在目录中)而不是在内容数据库中。所以,对我来说,问题是IIS不是SharePoint。任何想法? – TWEESTY

+0

我对你的解决方案的体系结构有点困惑。你说你正在上传到SharePoint服务器,但没有上传到SharePoint。我不怀疑这是你以为你在做什么,但我怀疑SharePoint拦截了这个请求并拒绝了你的大量上传。 –

+0

你说你正在上传到SharePoint服务器,但没有上传到SharePoint。我怀疑SharePoint拦截了该请求并拒绝了您的大量上传。 你是说你有一个SharePoint的虚拟目录和一个不同的这个任务?如果是这种情况,那么它可能会工作,因为SharePoint内部的WEBDAV实现不会拦截您的请求。如果您假定您可以利用SharePoint WEBDAV功能,那么您错了。 我会检查IIS日志,看看谁在处理你的请求。 –