Is this really the version you are looking for? Kentico Xperience 8 Documentation is no longer updated. Use the switcher in the header to choose your product version.
Media libraries on your site can be secured or unsecured. To ensure the required functionality, several settings need to be done as described below.
By default, files in media libraries are NOT secured and can be accessed directly by anybody who knows the exact link to the file. If you want to prevent this behavior, secure your media library as described in this topic.
Secured media libraries allow viewing of their content to members of authorized roles or to authenticated users only. Keep in mind that secured media libraries are slower than the unsecured ones as permission checking involves processing overhead.
You have to set up your IIS so that files can't be downloaded directly from the library by typing the link to the file like <site url>/media/file.jpg into the browser.
To open IIS, navigate to Start -> Control Panel -> Administrative Tools and start the Internet Information Services (IIS) Manager.
In the connections pane, select the application for which you want to change the settings.
Navigate to the folder of your application for which you want to want to change the settings. You can find individual media library folders under <site name>/media.
In the Features View, double-click on Authentication.
Select Anonymous Authentication.
In the Actions list, click on Disable.
(Optional) If Windows Authentication is enabled as well, disable it.
Once you changed the settings in IIS, you need to make changes in Kentico as well.
By default, Kentico doesn't check for the See library content permission. To make the system check for the permission, you need to turn on the Check file permissions option as described below.
When writing your transformations for the Media gallery web part, you should stick to the following rules:
Obtain File previews and file details using the following control:
<cc1:MediaFilePreview ID="filePreview" runat="server" maxsidesize="117" />Obtain Download links using the following method:
<%# MediaLibraryFunctions.GetMediaFileUrl(Eval("FileLibraryID"), Eval("FilePath"), Eval("FileGUID"), Eval("FileName"), GetDataControlValue<bool>("UseSecureLinks")) %>You can see an example of a use of this web part, including the defined transformations, on the Community Site sample website, in the Media section.
Using the settings above, you can ensure that only members of authorized roles or authenticated users are allowed to view media library content.
Secured media libraries allow viewing of their content to members of authorized roles or to authenticated users only. Keep in mind that secured media libraries are slower than the non-secured ones as permission checking involves processing overhead.
You have to set up your IIS so that files can be downloaded directly from the library by typing the link to the file like <site url>/media/file.jpg into the browser.
To open IIS, navigate to Start -> Control Panel -> Administrative Tools and start the Internet Information Services (IIS) Manager.
In the connections pane, select the application for which you want to change the settings.
Navigate to the folder of your application for which you want to want to change the settings. You can find individual media library folders under <site name>/media.
In the Features View, double-click on Authentication.
Select Anonymous Authentication.
In the Actions list, click on Enable.
(Optional) If you disabled Windows authentication in order to secure your media libraries previously, you can now enable it.
Once you changed the settings in IIS, you need to make changes in Kentico as well.
Note that if you want to change the settings temporarily and then revert back to the secured mode, you can simply turn checking file permissions off.
When writing your transformations for the Media gallery web part, you should stick to the following rules:
Obtain File previews and file details using the following control:
<cc1:MediaFilePreview ID="filePreview" runat="server" maxsidesize="117" />You can obtain other file type previews, details and download links directly.