Format / FileSizeViewHelper

ViewHelper to render the filesize

Type: Basic

General properties

Name: Type: Description: Default value:
* file string Path to the file  
format string Labels for bytes, kilo, mega and giga separated by vertical bar (|) and possibly encapsulated in “”. Eg: ” | K| M| G” (which is the default value)  
hideError boolean Define if an error should be displayed if file not found  

Examples

Basic example

If format is empty, the default from TYPO3CMSCoreUtilityGeneralUtility:::formatSize() is taken.

Code:

<n:format.fileSize file="uploads/tx_news/{relatedFile.file}" format="' | K| M| G'" />

Output:

3 M