Creating a new document in a Document Library
string _siteUrl = "https://localhost";
using (SPSite _site = new SPSite(_siteUrl))
{
using (SPWeb _web = _site.OpenWeb())
{
SPFolder _folder = _web.Folders["<Document Library Name>"];
_web.AllowUnsafeUpdates = true;
_folder.Files.Add("Contoso Final Document + "." + extension, bytes);
}
}
Comments
- Anonymous
December 05, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/12/06/creating-a-new-document-in-a-document-library/