SaaS CMS has officially launched! Learn more now.

Programically create sub folder in an existing folder



   Iam trying to create a sub folder from the code and i have the ContentReference of the parent folder.

   I know how to add a media file to an existing folder(using blob factory),

   but before i add the file i want to create a sub folder programically, get its contentLink and then add the file to it.

   Somebody know how to do that?

   Manually i can do it by doing a right click on a folder and choose New Folder.   

Thank You!

Zvika Kozniak.

Sep 01, 2014 16:49


Folders are like regular content. so...

var repository = ServiceLocator.Current.GetInstance();

var folder = repository.GetDefault(yourParentContentLink);
folder.Name = "Test";
var folderReference = repository.Save(folder, SaveAction.Publish, AccessLevel.NoAccess);
Sep 02, 2014 3:50

Understood, It Worked!

Thank you!! :)

Sep 02, 2014 9:09
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.