Trouble saving uploaded media file to "Upload Data Type" field
Hi,
I have managed to add a File upload field to my member profile area and save the file to the media section, however I can't seem to find the right combination of path & file name for the string to save in Upload field on the member.
I've tried a combination of path and ID, the link in the admin next to the upload field is : "/media/1152" How do I get the correct path to the file ?
Thanks,
Kyle
Here's my code so far:
if (model.CVFile != null)
{
var mediaService = Services.MediaService;
//CreateMedia takes the name of the media you are created, the id of the parent and finally the alias of the MediaType that you want the media to be based on.
var media = mediaService.CreateMedia(model.CVFile.FileName, 1137, "File");
mediaService.Save(media);
media.SetValue("umbracoFile", model.CVFile);
//And then save it similar to the above snippet
mediaService.Save(media);
updateMember.getProperty("CVFile").Value = media.Id;
}
Trouble saving uploaded media file to "Upload Data Type" field
Hi,
I have managed to add a File upload field to my member profile area and save the file to the media section, however I can't seem to find the right combination of path & file name for the string to save in Upload field on the member.
I've tried a combination of path and ID, the link in the admin next to the upload field is : "/media/1152" How do I get the correct path to the file ?
Thanks,
Kyle
Here's my code so far:
Did you ever find a solution for this?
is working on a reply...