[TYPO3-english] Extbase FAL file download
Sinisa Mitrovic
sinisa.mitrovic at avisto-eastern.com
Fri Jun 27 09:14:03 CEST 2014
Hi everybody,
I have question about file download with Extbase and FAL. I can render
image with:
<f:image src="{file.uid}" alt="" width='100' height="100"
treatIdAsReference="1"/>
I can get image, but I also have PDF file for download, and I can't use
this ViewHelper. Is there any other ViewHelper for file downloads?
If i dump that file i get this:
file => TYPO3\CMS\Extbase\Domain\Model\FileReferenceprototypepersistent
entity (uid=1, pid=1)
originalResource => NULL
uid => 1 (integer)
_localizedUid => 1 (integer)modified
_languageUid => 0 (integer)modified
pid => 1 (integer)
originalResource is null for file, and for image, but image is printed
with that ViewHelper. And I can't get file...
In my TCA I have this for file:
'file' => array(
'exclude' => 1,
'label' =>
'LLL:EXT:extension/Resources/Private/Language/locallang_db.xlf:tx_extension_domain_model_downloadfile.file',
'config' =>
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'file',
array('maxitems' => 1),
'pdf, zip, doc, docx, xls, xlsx'
),
),
I can use default Typo3 file instead like
'file' => array(
'exclude' => 0,
'label' =>
'LLL:EXT:extension/Resources/Private/Language/locallang_db.xlf:tx_extension_domain_model_downloadfile.file',
'config' => array(
'type' => 'group',
'internal_type' => 'file',
'allowed' => 'pdf, zip, doc, docx, xls, xlsx',
'disallowed' => 'php,php3',
'max_size' =>
$GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
'uploadfolder' => 'uploads/tx_extension',
'show_thumbs' => 1,
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
Is there a way, or ViewHelper to do this with FAL?
Best regards,
More information about the TYPO3-english
mailing list