I have a rather odd issue on an site that has been running for a while. Suddenly some images are not showing and if I go to the image path directly I get a 404.
Within the Media Library the Image exists but the image doesn't show. Where the image would show is just text stating Upload Image but there is no Upload image button to actually upload something.
I have looked on the web server and the images exist within the file structure in the correct location so Umbraco must be doing something to force the 404.
The only thing I have noted is that the path to the image is media/1443/filename.jpg but within the umbracoNode database table the id is 2032 and the back end properties show the id as 2032 should all the numbers be the same? And if so what has happened and is there a fix?
Missing images
I have a rather odd issue on an site that has been running for a while. Suddenly some images are not showing and if I go to the image path directly I get a 404.
Within the Media Library the Image exists but the image doesn't show. Where the image would show is just text stating Upload Image but there is no Upload image button to actually upload something.
I have looked on the web server and the images exist within the file structure in the correct location so Umbraco must be doing something to force the 404.
The only thing I have noted is that the path to the image is media/1443/filename.jpg but within the umbracoNode database table the id is 2032 and the back end properties show the id as 2032 should all the numbers be the same? And if so what has happened and is there a fix?
I am using version 7.5.3 any help appreciated.
I seem to have solved my own issue but there seems to be an issue with
MediaService.GetMediaByPath()
In a standard controller the correct path is generated e.g. /media/1234/FileName.jpg
but the following does not return the media object it just returns null.
IMediaService mediaService = ApplicationContext.Current.Services.MediaService;
IMedia media = mediaService.GetMediaByPath("/media/1234/FileName.jpg");
is working on a reply...