Try our conversational search powered by Generative AI!

Get or Create a Media Folder Path



I am trying to upload a Media file to EpiServer media folder. The parameters sent are the file and the path in which I want the file to be uploaded. The path may or may not be present in the CMS

[eg: Test Folder 2/Test Folder 2.2/]

If it is available I want the reference of the folder so that I can upload the file to it and if not I want all the folder in the path to be created and then get the reference of the newly created folder.

Since I am very new to EpiServer I have little knowledge about where to find the APIs and examples. Infact I tried the following :

public static UnifiedDirectory CreateDirectory(string virtualPath);

but it is giving a null value as return on following call 

var dir = UnifiedDirectory.CreateDirectory("~/Global/Test Folder 2/Test Folder 2.2/");

Oct 13, 2015 11:49


Which EPiServer version are you using?

Shouldn't you use ContentFolder to create subdirectory for media?

Oct 13, 2015 12:09

Its EpiServer 7.5

Oct 13, 2015 16: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.