简体   繁体   English

Umbraco媒体文件夹的异常行为

[英]Strange behaviour of Umbraco media folder

I'm having some trouble with an Umbraco website. 我在Umbraco网站上遇到了一些麻烦。 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. CMS的用户无法登录服务器,因此他们不会意外删除自己的文件。 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. 我们已经分析了整个Media文件夹的文件系统备份,并且这些项目也不存在,因此我们可以排除文件系统出现问题的可能性。

The version we are using is: Umbraco v 4.7.1.1 (Assembly version: 1.0.4868.25172) 我们使用的版本是:Umbraco v 4.7.1.1(程序集版本:1.0.4868.25172)

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. 这样一来,仿佛幽灵正在删除图像,但是在发布更改时,其Umbraco 4会删除文件。

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. 我在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. 我从未在Umbraco 6和7上遇到过此问题。但是,在那些系统上,我使用媒体选择器而不是为所有类似媒体的元素上载。

There are no issues I know of with Umbraco 4.7.x deleting its own media. Umbraco 4.7.x删除自己的媒体没有任何问题。 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. 如果通过RDP连接复制文件,复制的文件没有完全复制,并且在此过程中某些文件实际上从目标文件夹中消失,我也看到了一个问题。

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. 但是无论哪种方式,我都会检查您的内部进程,也许将媒体文件夹移动到虚拟目录中,以避免覆盖它的机会。

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. 在我管理的系统上,以前发生的事情是,编辑者复制了一个页面,其中包含先前上传的图像,但从未更新该图像,而将路径保留为“ Upload”字段的值。

In this scenario, you would have 2 published pages that have a field with the same path. 在这种情况下,您将有2个发布的页面,它们的字段具有相同的路径。

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. 这样会使复制的页面的图像链接断开,而图像丢失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM