At 3:39 PM -0700 7/24/01, Bob Scott wrote:
>There's a nifty little function called filesize()...
>
>I've done this before to make human-readable output:
>
>$my_file = "/path/to/my/file";
>
>$file_size = filesize($my_file);
>
>if ($file_size >= 1073741824) {
> $show_filesize = number_format(($file_size / 1073741824),2) . "
>GB";
>} elseif ($file_size >= 1048576) {
> $show_filesize = number_format(($file_size / 1048576),2) . " MB";
>} elseif ($file_size >= 1024) {
> $show_filesize = number_format(($file_size / 1024),2) . " KB";
>} elseif ($file_size >= 0) {
> $show_filesize = $file_size . " bytes";
>} else {
> $show_filesize = "0 bytes";
>}
>
>echo "File $my_file is $show_filesize ";
Wow!! Can I be effusive!!! :) It worked like a charmed. I just added
my path statement, and then placed the $show_filesize after the url
to the document. It's beautiful!!!
Thanks!
Alnisa
--
.........................................
Alnisa Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412 (fx) 415.337.7927
(url) http://www.nonprofit-techworld.org
(url) http://www.nonprofit-tech.org
(url) http://www.tech-library.org
.........................................
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
.........................................
applying technology to transform
.........................................
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]