File download size
Contents
Syntax
<txp:file_download_size />
The file_download_size tag is a single tag which Textpattern will replace with the formatted file size of the file to be downloaded. Should be used in Textpattern ‘file’ type Form templates.
Attributes
Tag will accept the following attributes (case-sensitive) as well as the global attributes :
decimals="places"
- Number of decimal places to format the value to.
- Default:
2
. format="numbering style"
- The way to represent the number, based on the file’s expected size.
- Values:
b
(bytes).
k
(kilobytes).
m
(megabytes).
g
(gigabytes).
t
(terabytes).
p
(petabytes).
e
(exabytes).
z
(zettabytes).
y
(yottabytes). - Default: unset (i.e. the most appropriate units based on the file size).
Examples
Example 1: Display formatted file size in kilobytes
<txp:file_download_size format="k" />