A simple Statamic plugin to output file information.
Drop the fileinfo
folder into the Statamic /_add-ons/
folder. If you have downloaded from github just remove the -master from the end of the folder name. You can delete the contents except for the pi.fileinfo.php file itself.
<ul>
{{ fileinfo file="/assets/docs/mydocument.pdf" }}
<li>Your file extension is: {{ file_ext }}
<li>Your file size is: {{ file_size }}
{{ /fileinfo }}
</ul>
- file
{{ file_ext }}
grabs the file extension{{ file_size }}
grabs the file size{{ file_size_kilobytes }}
grabs the file size and converts it to kilobytes