TYPO3 Logo
Secure Downloads
Options
View source How to edit Full documentation (single file)

Secure Downloads

  • For Administrators
    • Extension Configuration
    • Regular Expressions
  • For Editors
  • For Developers
    • Events
    • Secured Links
    • Token
    • Security Checks
  • About
    • Changelog
      • Version 5.0.6 - 2024/09/23
      • Version 5.0.5 - 2024/09/17
      • Version 5.0.4 - 2023/03/22
      • Version 5.0.3 - 2023/10/27
      • Version 5.0.2 - 2023/06/30
      • Version 5.0.1 - 2023/05/26
      • Version 5.0.0 - 2023/05/05
      • Version 4.1.6 - 2022/12/15
      • Version 4.1.5 - 2022/12/09
      • Version 4.1.4 - 2021/11/09
      • Version 4.1.1 - 2020/06/03
      • Version 4.1.0 - 2020/05/06
      • Version 4.0.0 - 2019/12/03
      • Version 3.0.3 - 2020/05/04
      • Version 3.0.2 - 2019/12/03
      • Version 3.0.1 - 2019/11/20
      • Version 3.0.0 - 2018/11/20
      • Version 2.0.6 - 2018/11/20
      • Version 2.0.5 - 2017/04/20
      • Version 2.0.4 - 2017/04/05
      • Version 2.0.3 - 2016/08/30
      • Version 2.0.2 - 2016/07/22
      • Version 2.0.1 - 2016/07/22
      • Version 2.0.0 - 2016/07/21
  1. Secure Downloads
  2. For Developers
  3. Secured Links

Secured Links 

Following examples clarifies, how to retrieve secured links from different data type sources.

File Object 

Instance of \TYPO3\CMS\Core\Resource\File given:

/** @var \TYPO3\CMS\Core\Resource\File $file */
$securedUrl = $file->getPublicUrl();
Copied!

File Reference 

Instance of \TYPO3\CMS\Core\Resource\FileReference given:

/** @var \TYPO3\CMS\Core\Resource\FileReference $fileReference */
$securedUrl = $fileReference->getPublicUrl();
Copied!

Fluid Templates 

Getting secured links within a fluid template is a no-brainer; you don't have to pay attention to anything here:

<f:image image="{image}" class="img-fluid img-thumbnail" />
<f:image image="{image}" treatIdAsReference="TRUE" class="img-fluid img-thumbnail" />
<img src="{image.publicUrl}" class="img-fluid img-thumbnail" />
Copied!

API 

Get a link that is only valid for user 29, with user group 12, is generated on page 89 and expires on 2022/05/08:

$publicUrl = '/fileadmin/secured/invoice.pdf';
$secureDownloadService = GeneralUtility::makeInstance(SecureDownloadService::class);

if ($secureDownloadService->pathShouldBeSecured($publicUrl)) {
    $securedUrl = GeneralUtility::makeInstance(SecureLinkFactory::class)
        ->withResourceUri(rawurldecode($publicUrl))
        ->withUser(29)
        ->withPage(89)
        ->withGroups([12])
        ->withTimeout(1659650400)
        ->getUrl();
}
Copied!
  • Previous
  • Next
Reference to the headline

Copy and freely share the link

This link target has no permanent anchor assigned.The link below can be used, but is prone to change if the page gets moved.

Copy this link into your TYPO3 manual.

Last rendered: Oct 29, 2025 16:25

  • Legal Notice
  • Privacy Policy