I'm having an issue after uploading images on a page in the frontend. These get saved on a folder in the media section.
I'm using mediaService.CreateMedia() and mediaService.Save().
The images get saved properly but once Umbraco restarts (e.g. when updating dlls) the images disappear from the media section of the backoffice although they're still in the media folder.
I wonder if the cache needs updated somehow?
Might be worth noting that "ImageApproval" is a custom media type.
My Umbraco version is 7.7.6.
Relevant code bellow:
var mediaService = Services.MediaService;
var media = mediaService.CreateMedia(imageName, settings.ImageFolderId.Value, "ImageApproval");
mediaService.Save(media);
media.SetValue("umbracoFile", model.Image);
media.SetValue("firstName", model.FirstName);
media.SetValue("lastName", model.LastName);
media.SetValue("emailAddress", model.EmailAddress);
media.SetValue("facebookProfile", model.FacebookProfile);
media.SetValue("twitterProfile", model.TwitterProfile);
media.SetValue("instagramProfile", model.InstagramProfile);
mediaService.Save(media);
I just compared database snapshots from before and after rebuilding the solution. Left is before and right is after.
Somehow some fields were removed from various tables. How can this happen?
Uploaded images using media service disappear
I'm having an issue after uploading images on a page in the frontend. These get saved on a folder in the media section. I'm using
mediaService.CreateMedia()
andmediaService.Save()
.The images get saved properly but once Umbraco restarts (e.g. when updating dlls) the images disappear from the media section of the backoffice although they're still in the media folder. I wonder if the cache needs updated somehow?
Might be worth noting that "ImageApproval" is a custom media type. My Umbraco version is 7.7.6.
Relevant code bellow:
I just compared database snapshots from before and after rebuilding the solution. Left is before and right is after. Somehow some fields were removed from various tables. How can this happen?
Turns out it was a delete action on uSync. Still not sure how it found it's way there.
is working on a reply...