2016-09-17 84 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日誌,看看誰在處理你的請求。 –