Protecting media files under a disclaimer

Sometimes, we get a requirement to protect media files by showing a disclaimer, which means we need to put a disclaimer before viewing any media file to prevent abuse by setting governing laws, owning the content, protecting documents from search engines, and so on. In such cases, the user will first agree to the disclaimer and then will be able to view the media documents.

In this recipe, you will learn showing disclaimers on media items using MediaRequestHandler.

How to do it…

We will first create a Disclaimer Content Page, which will be opened when a user opens a protected media item:

  1. Create a Disclaimer Page template with two fields, Title and Description. Create a content page, /Home/Privacy-Disclaimer ...

Get Sitecore Cookbook for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.