private void AddSPListItemByRelativeUrl(SPList list, string relativeFolderurl)
{
//Add the files in sharepoint list under this folder.
//If we want to add an item under "myFirstfolder/mynextfolder" folder, then the relativeFolderurl must be Lists/myList/myFirstfolder/mynextfolder
SPListItem newFileItem = list.Items.Add("/" + relativeFolderurl, SPFileSystemObjectType.File, null);
newFileItem["Title"] = "My new folder";
newFileItem.Update();
}
No comments:
Post a Comment