Go to main content

File download size



<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) as well as the global attributes :

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" />

If you notice any kind of problem with this page’s construction or content (outdated information, typos, broken links, or whatever), open an issue to have it sorted. Or have a go at it yourself. :)