http://msdn.microsoft.com/en-us/library/ms454491.aspx
http://www.codeproject.com/Articles/20023/ASP-NET-2-0-FileUpload-Server-Control
if (FileUpload1.HasFile)
{
Hashtable reqProperties = new Hashtable();
reqProperties.Add("vti_title", "Test");
String fileToUpload = FileUpload1.PostedFile.FileName;
String documentLibraryName = "Submissions";
Stream fStream = FileUpload1.PostedFile.InputStream;
byte[] contents = new byte[fStream.Length];
SPFolder myLibrary = SPContext.Current.Web.Folders[documentLibraryName];
SPFile spfile = myLibrary.Files.Add(FileUpload1.FileName, contents, reqProperties, true);
}
http://www.codeproject.com/Articles/20023/ASP-NET-2-0-FileUpload-Server-Control
if (FileUpload1.HasFile)
{
Hashtable reqProperties = new Hashtable();
reqProperties.Add("vti_title", "Test");
String fileToUpload = FileUpload1.PostedFile.FileName;
String documentLibraryName = "Submissions";
Stream fStream = FileUpload1.PostedFile.InputStream;
byte[] contents = new byte[fStream.Length];
SPFolder myLibrary = SPContext.Current.Web.Folders[documentLibraryName];
SPFile spfile = myLibrary.Files.Add(FileUpload1.FileName, contents, reqProperties, true);
}
No comments:
Post a Comment