Monday April 15, 2024 - 8:55:05 PM

Registered Linux User #440901    

Login    Register
Login Required

PHP File Size Information

To get the size of a file with php use this function:

function filesize_readable($pathz)
$fsize = filesize($pathz);
$runits = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$mult = $fsize > 0 ? floor(log($fsize, 1024)) : 0;
return number_format($fsize / pow(1024, $mult), 2, '.', ',') . ' ' . $runits[$mult];
print("The file " . $thefile . " is " . filesize_readable($thefile));

The above function could be used in conjunction with the gzip function and/or included in your functions include file(s).

If you would like some information on how to do something use the Contact Page. Someone will get back with you with an answer.

“Windows - Just Say No”

Time since last reboot: 6 days, 9 hours, 39 minutes, 33 seconds

Page generated in zero point three seven (0.37) seconds.

@ Active Member Project Honeypot  email addresses

This page was last modified on 12/21/18 @ 11:55:49:pm
This file name: info_php_filesize.php

Questions, Comments, Suggestions or Requests should be sent to: 

There have been  10634  Unique Visitors (IP Addresses) to this site.

Current users online : 19
Maximum users at a time : 60
Last 25 attacks have come from:

There are currently 25 unique IP addresses blacklisted.

Public Server Status
server online dbc001  db cluster service
 Is On-Line
server online www03  web service
 Is On-Line
server online www  web service
 Is On-Line
server online mx 08  mail service
 Is On-Line
server online www ha  F/O web service
 Is On-Line
server online mx 11  mail service
 Is On-Line
server online Primary  Client DNS
 Is On-Line
server online Secondary  Client DNS
 Is On-Line

©Copyright 2004-2024 - - Redd Enterprises™, Inc.,  All Rights Reserved.
Ubuntu® is a registered trademark of Canonical Ltd.
Linux® is a registered trademark of Linus Torvalds.
Apache® is a registered trademark of The Apache Software Foundation.
PHP® is a registered trademark of The PHP Group.
The MariaDB® a registered trademark of the MariaDB Corporation Ab.
MySQL® is a registered trademark of the Oracle Corporation Inc.
All other product and service names mentioned are the trademarks of their respective companies.


Let us know what you think!