Copied to clipboard

Flag this post as spam?

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


  • Martin 114 posts 313 karma points
    Nov 28, 2014 @ 08:13
    Martin
    0

    Store Base64 images in the media folder

    Hi,

    Is it possible to "upload"/store Base64 images in the media folder, and to use the media picker in RTE to insert it?

    Regards, Martin

  • Alex Skrypnyk 6148 posts 24077 karma points MVP 8x admin c-trib
    Nov 28, 2014 @ 13:18
    Alex Skrypnyk
    100

    Hi Martin,

    Yes, this is is possible. You have to create your custom controller which will be handle file uploading and creating media object.

    Example :

    if (ApplicationContext.Current != null)
        {
            var ms = ApplicationContext.Current.Services.MediaService;
            //Use the MediaService to create a new Media object (-1 is Id of root Media object, "Folder" is the MediaType)
            var mediaMap = ms.CreateMedia("Test", -1, "Folder");
            //Use the MediaService to Save the new Media object
            ms.Save(mediaMap);
        }
    

    http://our.umbraco.org/documentation/Reference/Management-v6/Services/MediaService

    Also you can use this tool for media uploading. http://our.umbraco.org/projects/website-utilities/desktop-media-uploader

    Thanks, Alexander

  • Martin 114 posts 313 karma points
    Dec 01, 2014 @ 19:37
    Martin
    0

    Thanks Alex. I will look into this.

Please Sign in or register to post replies

Write your reply to:

Draft