You could also create a model for the download template, and overwrite the url
function to point to the file instead. This way you don’t even need a template.
site/models/download.php
<?php
use Kirby\Cms\Page;
class DownloadPage extends Page {
public function url($options = null): string {
if($file = $this->file('myfile')) {
return $file->url();
}
return parent::url($options);
}
}
haven’t tried it, but should work