Solution to protect files

Hey everyone,

I’ve implemented this solution to protect pages, it works very well. But the files are still accessible if you have a URL.

What would be the best way to implement file protection so that only logged in users can access them?

This is how the pages where the files are stored look like (simplified structure):

- home
- datenbank
-- urlaubsantrag
--- document.txt
--- urlaubsantrag.docx
-- zwischenbericht
--- document.txt
--- zwischenbericht.docx
-- abschlussbericht
--- document.txt
--- abschlussberich.docx

See Protecting files behind a firewall | Kirby CMS

This is the first thing I tried, but then I noticed that there are no templates assigned to files. For example, in the cookbook, files with template protected are filtered.

I have about 900+ files that are grandfathered from Kirby 2 and therefore have no file template attached to them. :frowning:

The strucutre is one subpage with page template document, and file linked in field, this is how document.txt file looks like for this folder:

...
-- urlaubsantrag
--- document.txt
--- urlaubsantrag.docx
// document.txt content

Title: Urlaubsantrag
----
Documentselect: urlaubsantrag.docx

I read this topic:

and this helped definitely :slight_smile: