Copied to clipboard

Flag this post as spam?

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


  • zell 37 posts 90 karma points
    Nov 03, 2014 @ 02:28
    zell
    0

    create image cropper image in backend

    hi,
    i'm trying to create an Image using the MediaService.CreateMedia.
    however, because umbracoFile is of datatype Image Cropper i can't pass in the stream.. i some how need to create the object that stores the image cropper info.

    how can i do this?
    Is there a way to create an image cropper object? or do i manually have to create the json?
    how do i add the media file to get the image url?
    is there a way to return a node ID of the created media?

    var mediaImage = Services.MediaService.CreateMedia(model.Image.FileName, 3884, MediaTypes.Image);

    mediaImage.SetValue("umbracoFile", model.Image.InputStream); // this fails because it's expecting string,string

    Services.MediaService.Save(mediaImage);


    thanks!

  • How Do I Delete My Account? 68 posts 433 karma points
    Jul 27, 2015 @ 00:18
    How Do I Delete My Account?
    0

    Wonders the same thing. Did you found an answer to it?

    Update: I've converted the whole thing to JSON myself in backend and it works perfectly. The only problem seems to be able to get the newly saved image path to store in the image cropper JSON-object.

    TO BE CONTINUED

Please Sign in or register to post replies

Write your reply to:

Draft