Feature: #92518 - Introduce FileViewHelper

See forge#92518

Description

With #92518, the \TYPO3\CMS\Core\Controller\FileDumpController has been extended with new options to force the download of a file, as well as the option to define a custom filename.

To ease the use of the file dump functionality, especially the newly introduced options, a new ViewHelper \TYPO3\CMS\Fluid\ViewHelpers\Link\FileViewHelper is added, which allows extension authors to easily create links to both public and non-public files.

The usage is as following:

<f:link.file file="{file}" download="true" filename="alternative-name.jpg">
   Download file
</f:link.file>
Copied!

The above example will create a link to the given file, forcing a direct download, while using the alternative filename.

In case the file is publicly accessible, a direct link will be used. Otherwise the file dump functionality comes into play.

<!-- Public file -->
<a href="https://example.com/fileadmin/path/to/file.jpg"
   download="alternative-name.jpg"
>
   Download file
</a>

<!-- Non-public file -->
<a href="https://example.com/index.php?eID=dumpFile&t=f&f=123&dl=1&fn=alternative-name.jpg&token=79bce812">
   Download file
</a>
Copied!

Impact

The new ViewHelper allows creating links to files - even non-public ones - in a straightforward way within Fluid templates.