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
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.
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!
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
is working on a reply...