protected function forwardJumpUrlSecureFileData($jumpUrl)
    {
        // Set the parameters required for handling a secure jumpUrl link
        // The locationData GET parameter, containing information about the record that created the URL
        $locationData = (string)GeneralUtility::_GP('locationData');
        // The optional mimeType GET parameter
        $mimeType = (string)GeneralUtility::_GP('mimeType');
        // The jump Url Hash GET parameter
        $juHash = (string)GeneralUtility::_GP('juHash');

        // validate the hash GET parameter against the other parameters
        if ($juHash !== JumpUrlUtility::calculateHashSecure($jumpUrl, $locationData, $mimeType)) {
            throw new \Exception('The calculated Jump URL secure hash ("juHash") did not match the submitted "juHash" query parameter.', 1294585196);
        }

        if (!$this->isLocationDataValid($locationData)) {
            throw new \Exception('The calculated secure location data "' . $locationData . '" is not accessible.', 1294585195);
        }

        // Allow spaces / special chars in filenames.
        $jumpUrl = rawurldecode($jumpUrl);

        // Deny access to files that match TYPO3_CONF_VARS[SYS][fileDenyPattern] and whose parent directory
        // is typo3conf/ (there could be a backup file in typo3conf/ which does not match against the fileDenyPattern)
        if (version_compare(TYPO3_version, '8.0', '<')) {
            $absoluteFileName = GeneralUtility::getFileAbsFileName(GeneralUtility::resolveBackPath($jumpUrl), false);
        } else {
            $absoluteFileName = GeneralUtility::getFileAbsFileName(GeneralUtility::resolveBackPath($jumpUrl));
        }

        if (
            !GeneralUtility::isAllowedAbsPath($absoluteFileName)
            || !GeneralUtility::verifyFilenameAgainstDenyPattern($absoluteFileName)
            || GeneralUtility::isFirstPartOfStr($absoluteFileName, (PATH_site . 'typo3conf'))
        ) {
            throw new \Exception('The requested file was not allowed to be accessed through Jump URL. The path or file is not allowed.', 1294585194);
        }

        try {
            $resourceFactory = $this->getResourceFactory();
            $file = $resourceFactory->retrieveFileOrFolderObject($absoluteFileName);
            $this->readFileAndExit($file, $mimeType);
        } catch (\Exception $e) {
            throw new \Exception('The requested file "' . $jumpUrl . '" for Jump URL was not found..', 1294585193);
        }
    }
protected function forwardJumpUrlSecureFileData($jumpUrl)
    {
        // Set the parameters required for handling a secure jumpUrl link
        // The locationData GET parameter, containing information about the record that created the URL
        $locationData = (string)GeneralUtility::_GP('locationData');
        // The optional mimeType GET parameter
        $mimeType = (string)GeneralUtility::_GP('mimeType');
        // The jump Url Hash GET parameter
        $juHash = (string)GeneralUtility::_GP('juHash');

        // validate the hash GET parameter against the other parameters
        if ($juHash !== JumpUrlUtility::calculateHashSecure($jumpUrl, $locationData, $mimeType)) {
            throw new \Exception('The calculated Jump URL secure hash ("juHash") did not match the submitted "juHash" query parameter.', 1294585196);
        }

        if (!$this->isLocationDataValid($locationData)) {
            throw new \Exception('The calculated secure location data "' . $locationData . '" is not accessible.', 1294585195);
        }

        // Allow spaces / special chars in filenames.
        $jumpUrl = rawurldecode($jumpUrl);

        // Deny access to files that match TYPO3_CONF_VARS[SYS][fileDenyPattern] and whose parent directory
        // is typo3conf/ (there could be a backup file in typo3conf/ which does not match against the fileDenyPattern)
        if (version_compare(TYPO3_version, '8.0', '<')) {
            $absoluteFileName = GeneralUtility::getFileAbsFileName(GeneralUtility::resolveBackPath($jumpUrl), false);
        } else {
            $absoluteFileName = GeneralUtility::getFileAbsFileName(GeneralUtility::resolveBackPath($jumpUrl));
        }

        if (
            !GeneralUtility::isAllowedAbsPath($absoluteFileName)
            || !GeneralUtility::verifyFilenameAgainstDenyPattern($absoluteFileName)
            || GeneralUtility::isFirstPartOfStr($absoluteFileName, (PATH_site . 'typo3conf'))
        ) {
            throw new \Exception('The requested file was not allowed to be accessed through Jump URL. The path or file is not allowed.', 1294585194);
        }

        try {
            $resourceFactory = $this->getResourceFactory();
            $file = $resourceFactory->retrieveFileOrFolderObject($absoluteFileName);
            $this->readFileAndExit($file, $mimeType);
        } catch (\Exception $e) {
            throw new \Exception('The requested file "' . $jumpUrl . '" for Jump URL was not found..', 1294585193);
        }
    }
protected function forwardJumpUrlSecureFileData ( $ jumpUrl ) { // Set the parameters required for handling a secure jumpUrl link // The locationData GET parameter, containing information about the record that created the URL $ locationData = ( string ) GeneralUtility :: _GP ( 'locationData' ) ; // The optional mimeType GET parameter $ mimeType = ( string ) GeneralUtility :: _GP ( 'mimeType' ) ; // The jump Url Hash GET parameter $ juHash = ( string ) GeneralUtility :: _GP ( 'juHash' ) ; // validate the hash GET parameter against the other parameters if ( $ juHash !== JumpUrlUtility :: calculateHashSecure ( $ jumpUrl , $ locationData , $ mimeType ) ) { throw new \ Exception ( 'The calculated Jump URL secure hash ("juHash") did not match the submitted "juHash" query parameter.' , 1294585196 ) ; } if ( ! $ this -> isLocationDataValid ( $ locationData ) ) { throw new \ Exception ( 'The calculated secure location data "' . $ locationData . '" is not accessible.' , 1294585195 ) ; } // Allow spaces / special chars in filenames. $ jumpUrl = rawurldecode ( $ jumpUrl ) ; // Deny access to files that match TYPO3_CONF_VARS[SYS][fileDenyPattern] and whose parent directory // is typo3conf/ (there could be a backup file in typo3conf/ which does not match against the fileDenyPattern) if ( version_compare ( TYPO3_version , '8.0' , '<' ) ) { $ absoluteFileName = GeneralUtility :: getFileAbsFileName ( GeneralUtility :: resolveBackPath ( $ jumpUrl ) , false ) ; } else { $ absoluteFileName = GeneralUtility :: getFileAbsFileName ( GeneralUtility :: resolveBackPath ( $ jumpUrl ) ) ; } if ( ! GeneralUtility :: isAllowedAbsPath ( $ absoluteFileName ) || ! GeneralUtility :: verifyFilenameAgainstDenyPattern ( $ absoluteFileName ) || GeneralUtility :: isFirstPartOfStr ( $ absoluteFileName , ( PATH_site . 'typo3conf' ) ) ) { throw new \ Exception ( 'The requested file was not allowed to be accessed through Jump URL. The path or file is not allowed.' , 1294585194 ) ; } try { $ resourceFactory = $ this -> getResourceFactory ( ) ; $ file = $ resourceFactory -> retrieveFileOrFolderObject ( $ absoluteFileName ) ; $ this -> readFileAndExit ( $ file , $ mimeType ) ; } catch ( \ Exception $ e ) { throw new \ Exception ( 'The requested file "' . $ jumpUrl . '" for Jump URL was not found..' , 1294585193 ) ; } }
If the submitted hash is correct and the user has access to the
related content element the contents of the submitted file will
be output to the user.

@param string $jumpUrl The URL to the file that should be output to the user
@throws \Exception
If the submitted hash is correct and the user has access to the related content element the contents of the submitted file will be output to the user .