I need to add some files to a page's folder in PageFiles. I've tried something like this without any luck:
string pageFileID = Convert.ToString(pd["PageFolderID"]);
UnifiedDirectory pageFile = UnifiedFileSystem.GetDirectory( pageFileID );
//Is page directory does not exist, create one
if (pageFile == null)
pageFile = UnifiedFileSystem.CreateDirectory( pageFileID );
//Create a file
pageFile.CreateFile("testing.txt");
The problem is that I do not get any directory object from neither GetDirectory nor CreateDirectory.
string pageFileID = Convert.ToString(pd["PageFolderID"]); UnifiedDirectory pageFile = UnifiedFileSystem.GetDirectory( pageFileID ); //Is page directory does not exist, create one if (pageFile == null) pageFile = UnifiedFileSystem.CreateDirectory( pageFileID ); //Create a file pageFile.CreateFile("testing.txt");
The problem is that I do not get any directory object from neither GetDirectory nor CreateDirectory.