Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have image url , alias image
How to set value media picker ?
Do you have media Id already? After image upload you have to have media Id, then you can easily set media id to content node media picker like that:
var node =
var locaUdi = Udi.Create(Constants.UdiEntityType.Media, media.Key);
node.SetValue( "mediaPicker", locaUdi.ToString() );
i see have "media.Key"
So what is "media"?
Oh again you are. I will try Thank you very much
So, How to get media Id from Url or alias image
I want rename image url when save&public content.
So media id has not yet?
If anyone is having trouble with Umbraco 8 then this is how I do it.
You basically need to get the UDI of the media item and use this to pass into the media picker field.
var content = _contentService.GetById("content-node-id-here");
if (content != null)
IMedia media = _mediaService.GetById(mediaId);
if(media != null)
if(image != null)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted