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'm trying to store a file in the CMS backend via code but when I upload the file to media picker using code it creates the source as this image
But if I upload the file using CMS backend to a media picker then it works fine and creates the source UDI as following which works fine:
Does anyone know any solution to this, I need to get its URL, but if try to access it, it gives the following error ?
My code flow is, that it receives the file in the controller, saves it in the media folder and then in the document type it selects the file from the media using the following line of code:
IMedia media = Services.MediaService.CreateMedia(docName, 1878, Constants.Conventions.MediaTypes.File);
media.SetValue(Services.ContentTypeBaseServices, "umbracoFile", docName, files);
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted