Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.

 

Get or Create a Media Folder Path

Vote:
 

Hi,

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/");



#140208
Oct 13, 2015 11:49
Vote:
 

Hi,

Which EPiServer version are you using?

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

#140211
Oct 13, 2015 12:09
Vote:
 

Its EpiServer 7.5

#140219
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.