Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Terry Clancy 204 posts 944 karma points
    Aug 31, 2015 @ 05:44
    Terry Clancy
    0

    Problem using MediaService to create a Folder

    Hi Umbraco Folk,

    Based on code from https://our.umbraco.org/Documentation/Reference/Management/Services/MediaService I wrote the following lines of code:

     var ms = ApplicationContext.Current.Services.MediaService;
     var mediaMapFolder = ms.CreateMedia("TTImages", -1, "Folder");
     ms.Save(mediaMapFolder);
    

    This is successful in creating a folder node in node Umbraco/BackOffice/Media. But it does not create a new folder on disk as I expected at "/media/TTImages/".

    Please let me know if you can help explain what is happening or help me resolve this issue.

    Thanks very much,

    Terry Clancy ClanceZ

  • jivan thapa 194 posts 681 karma points
    Aug 31, 2015 @ 06:42
    jivan thapa
    0

    As far as I know. You are creating a media "TTImages with" the media type "Folder". Folder media type is for the back office. And Umbraco should not create a folder on the disk. It only exist on the umbraco back office.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Aug 31, 2015 @ 15:43
    Alex Skrypnyk
    0

    jivan wirtes true, you can't create folder on the disk in the media folder

Please Sign in or register to post replies

Write your reply to:

Draft