日期:2014-05-18 浏览次数:21023 次
document.getElementById("oframe").Save("c:/temp/myfile.doc");
document.getElementById("oframe").HttpInit();
document.getElementById("oframe").HttpAddPostCurrFile("FileData", "myfile.doc");
document.getElementById("oframe").HttpPost("http://mytest/upload.aspx");
for (int i = 0; i < Request.Files.Count; i++)
{
if ((Request.Files[i].FileName == "" && Request.Files[i].FileName != null))
continue;
if (Request.Files[i].ContentLength > 0)
{
string filename = System.IO.Path.GetFileName(Request.Files[i].FileName);
HttpPostedFile file = Request.Files[i];
byte[] fileContents = new byte[file.ContentLength];
file.InputStream.Read(fileContents, 0, file.ContentLength);
SPFile spFile = folder.Files.Add(filename, fileContents, true);
spFile.Item.SystemUpdate();
file.InputStream.Close();
file.InputStream.Flush();
}
}