tlm / readfile-filter
Exposes readfile() to twig template filter.
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:craft-plugin
Requires
- craftcms/cms: ^3.0.0
This package is auto-updated.
Last update: 2025-06-22 20:21:28 UTC
README
Exposes readfile() to twig template filter. Allows to display PDF files directly in the browser, obfuscating the real file path. Files of other types than PDF will download automatically.
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require tlm/readfile-filter
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Readfile.
Using Readfile in your templates
{{ asset.one().url | readfile }}