我想在類文件中保存一個文件。 我在寫附件用戶控件。在類中保存文件的最佳方式
通過上傳控件上傳文件後,我想將其保存在類中,然後再上傳SharePoint中的文件。
用戶可以上傳多個文件。
只有當用戶點擊save
按鈕後,我會將所有文件和其他數據,文件保存到SharePoint和其他數據到數據庫。
這裏是我的類
public class Document :
{
public string documentName, documentPath, spServerURL, spDocumentLibraryURL;
public DateTime lodegmentDate;
public System.Web.HttpPostedFile postedFile;
}
我應該如何處理呢?可以使用httpPostedFile
嗎?在更新期間,我可以將SPFile
轉換爲httpPostedFile
嗎?
「hold a file」是什麼意思? – Oded
如果你打算保存多個文件,你應該使用HttpPostedFile的多個實例(或任何其他可以容納文件的對象) – Shai
我不認爲'InputStream'會喜歡存儲在Session中,所以請閱讀將流存儲到該「Document」中的'byte []'流中。 –