Dear forum
I followed this cookbook to protect specific files:
In the panel within a text field nested in a layout field I point to one of these protected files with selecting the desired text, adding an anchor, selecting the file, save
My Text:
- Download as Zip (pointing to the protected file)
- Download as MP4 (pointing to the protected file)
This gets rendered as such:
<a href="https://my-domain.com/protected-downloads/download_as_zip.zip" >Download as Zip</a>
<a href="https://my-domain.com/protected-downloads/download_as_mp4.mp4" >Download as MP4</a>
Everything works fine, the file URL is not accessible when not logged in, the downloads are working.
However, on Android devices this does not work and the download is corrupt because the download is an HTML instead of ZIP or MP4.
Now, I try to fix this with adding the “download” attribute to the anchor tag.
According to the docs, the kirby tag “file” gets rendered with the download attribute.
But using kirbytag within the text field does not work with the “file” tag.
(file: download_as_zip.zip)
=> results in <p>download_as_zip.zip</p>
Sidenote: The link tag works (link: dashboard text: Dashboard)
How would you access the protected files and add the download attribute?
Thanks a lot