File download size

On this page:


<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.


Tag will accept the following attributes (case-sensitive):

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.
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).


Example 1: Display formatted file size in kilobytes

<txp:file_download_size format="k" />

See something wrong in this document? Outdated info, a broken link, faulty code example, or whatever? Please open an issue and we’ll investigate.