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();
非常感謝
感謝您的回覆。但就我而言,我將文件上傳到服務器(在目錄中)而不是在內容數據庫中。所以,對我來說,問題是IIS不是SharePoint。任何想法? – TWEESTY
我對你的解決方案的體系結構有點困惑。你說你正在上傳到SharePoint服務器,但沒有上傳到SharePoint。我不懷疑這是你以爲你在做什麼,但我懷疑SharePoint攔截了這個請求並拒絕了你的大量上傳。 –
你說你正在上傳到SharePoint服務器,但沒有上傳到SharePoint。我懷疑SharePoint攔截了該請求並拒絕了您的大量上傳。 你是說你有一個SharePoint的虛擬目錄和一個不同的這個任務?如果是這種情況,那麼它可能會工作,因爲SharePoint內部的WEBDAV實現不會攔截您的請求。如果您假定您可以利用SharePoint WEBDAV功能,那麼您錯了。 我會檢查IIS日誌,看看誰在處理你的請求。 –