1
votes

I'm having some trouble with an Umbraco website. Some times some Media files disappear. The nodes still exist but the actual 'physical' file is gone. Also the folder the media file was in doesn't exist anymore.

The users of the CMS are unable to log in on the server, so they couldn't accidentally delete the files them self. Only me and my colleagues have access (and we wouldn't log in to a server unless it's necessary)

I just checked the disk space, and there are several gigs on all disk available.

We did a migration of the media folder some time ago, so we thought it might have something to do with it. We have analysed the file system backup of the whole Media folder and those items are not there as well so we can exclude the possibility of a problem on the filesystem.

The version we are using is: Umbraco v 4.7.1.1 (Assembly version: 1.0.4868.25172)

3

3 Answers

2
votes

If you clone content nodes with media files attached using an Upload property type, both nodes will point to the same media element. If you replace or remove the file on one node, it will remove the physical file. The original node will still have the reference to the removed file. This makes it appears as if a ghost is deleting images, but its Umbraco 4 deleting the file when you publish your change.

The best way to solve this is to convert your property from type Upload to type Media Picker.

I had this problem in sites around umbraco v4.5. I never run into this issue on Umbraco 6 and 7. But, on those systems, I use the media picker instead of upload for all media-like elements.

0
votes

There are no issues I know of with Umbraco 4.7.x deleting its own media. It is possible to do it remotely, but that would delete the nodes as well as the physical files.

The only cause is the one which seems most unlikely, and that is someone has accidentally deleted them. I find this occasionally happens when deploys are done. Someone replaces the media folder with the one from the staging environment.

I have also seen an issue if files are copied across an RDP connection, the files being copied are not copied completely and in the process some actually disappear from the target folder.

But either way, I would check your internal processes, maybe move the media folder to a virtual directory to avoid the chances of it being overwritten.

0
votes

There is one case in which media files might be deleted, and that is when you are using the Upload datatype on a document type.

What happened before on a system that I managed was that editors copied a page that included an image previously uploaded, but never updated the image, leaving the same path as the value for the Upload field.

In this scenario, you would have 2 published pages that have a field with the same path.

Now, if one editor decides to delete the page, the media file is also deleted. This would leave the copied page with a broken link to the image and a missing image.