|
|||||||||||||||||||||||||||||
![]() |
|
||||||||||||||||||||||||||||
|
[Content]
Displaying file size (getFileSize)Custom Tag: cf_getFileSizeThis tag allows you to automatically display the file size of any file on the web server. This comes in handy for large files such as PDFs, high-resolution graphics, or multimedia files. Stating the file size helps warn users that the file could take a long time to download. UsageThe following generic tag: <cf_getFileSize rel_path="relative_path_to_the_file" file_name="filename.extension" > populated with an actual relative path and file name: <cf_getFileSize rel_path="../construction_projects/" file_name="UWTPhase3Programming.pdf" > will produce output like this:
You must add your own parenthesis, etc. Oh, and notice that cf_icon is used to generate the PDF icon. :-) Disc storage units and accuracyThe tag will automatically display the file size in Gigabytes (GB), Megabytes (MB), Kilobytes (KB), or Bytes (B) as appropriate. Units may not be specified; the script chooses the largest unit having a value greater than or equal to one. Megabytes and Gigabytes are expressed to two decimal places. Kilobytes and Bytes are rounded to the nearest integer. Calculations are based on the following binary prefixes
|
||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||