Try our conversational search powered by Generative AI!

Adding files to a page's folder in PageFiles

Vote:
 
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.
#12467
Dec 07, 2005 13:41
Vote:
 
Hi! You should use UnifiedPageDirectory instead: UnifiedDirectory dir = UnifiedPageDirectory.Get(pd.PageLink);
#14320
Dec 28, 2005 17:30
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.