I get the following error when trying to create a folder:
Invalid file name.
The file name you specified could not be used. It may be the name of an existing file or directory, or you may not have permission to access the file.
I am trying to run the following code:
string folderName = "teststring";
SPList oList = web.Lists[Constants.List];
if (!oList.EnableFolderCreation)
{
oList.EnableFolderCreation = true;
oList.Update();
}
SPListItem folder = oList.Items.Add(List.RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder, folderName);
folder.Update();
This seems like pretty basic code and has worked for me in the past. I am running this on my dev machine as the system account. Is there anything basic I'm missing? I'm very confused as to why I can't make a simple folder anymore.