Closed (fixed)
Project:
Content Templates (Contemplate)
Version:
6.x-1.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 May 2008 at 18:29 UTC
Updated:
3 Apr 2010 at 16:30 UTC
Hi
print $node->field_file[0]['filesize']
prints filesize in bytes format.
Is it possible to get it in Kbytes format?
Thanks in advance.
Comments
Comment #1
nisaak commentedI had a similar issue, but I added some php code that did the calculation for me. I've posted the code below.
If anyone knows of a better way to do this, I would love to hear it!
Comment #2
jrglasgow commenteddoes this take care of the problem?
Comment #3
shane birley commentedAlmost. The script isn't recognizing the bytes to kilobytes. Here is a revised version of the script.
This has been tested and works in Drupal 5. It should work in Drupal 6. Thanks to Speedtech.it for helping fixing this up.
Comment #4
sin commentedThere is a better way:
Comment #5
marcushenningsen commented#4 did the trick. Thanks a lot.