0

I'm creating a Kentico media library file using Kentico API 11.0.26. The CMS and MVC app are on a web farm. Both are in healthy state.

The file gets created fine, but is only accessible on the CMS application, not on the MVC website. This is true for both Direct Path link as well we Permanent link.

Copying/pasting the Permanent link in browser preceded with MVC domain gives this message: "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

Can someone explain what "same UNC root defined " means in this section:

If you are running the system on a web farm and have the same UNC root defined on all servers, it is necessary to add the following key into your web.config file. The files stored in the libraries are then not transferred when synchronizing the web farm content:

<add key="CMSWebFarmSynchronizeMediaFiles" value="false"/>

https://docs.kentico.com/k12/configuring-kentico/configuring-the-environment-for-content-editors/configuring-media-libraries

4

1 回答 1

-1

UNC(通用命名约定)是识别网络上的服务器/机器的标准,使用如下:\\server-name\rest of path

在 Kentico 中,如果媒体库文件位于网络中的不同服务器上,您将使用 UNC 告诉 Kentico 您将媒体库文件存储在哪里。

首先想到的是为什么您会收到 404,这可能是媒体 URL 前面有一个波浪号 (~)。如果是这种情况,请删除该波浪号并查看问题是否已解决。就个人而言,我做了这样的替换:

MediaLibraryHelper.GetPermanentUrl(mediaLibraryFile).Replace("~/", "/")

我不知道是否有一个辅助函数可以为您提供一个 URL,而无需字符串替换波浪号。

于 2020-01-23T23:30:49.910 回答