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 a doctype that has multiple media picker, I am creating content of this type using content service and then looking to set the multiple media picker field code looks like
where MediaIds is List of ints, my question is will that work or do i need to give the value as csv string list or??
You will have to convert to CSV, something like this:
portfolio.SetValue(Helpers.DocTypeConstants.Portfolio.Images,String.Join(",", packageItem.MediaIds.Select(x => x.ToString()).ToArray()));
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.
if you are dealing with a multiple media picker from memory I believe it is a comma separated list of Udis.
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