How do I check the filesize of a stored image?
Posted: Mon Jun 13, 2016 4:48 pm
I need to add up all the images we have on a homepage, from the admin screen.
To do that, I want to get the filesize of each "banner" type image, and then at the bottom, show the filesize overall.
Sounds easy, but it won't let me even get one file size.
I can do it when I run an upload with the ['tmp'] format, but I want to get the filesize like this:
And all I get is this error:
[text]Warning: filesize(): stat failed for /images/pages/97242645m27g.jpg in C:\xampp\phpMyAdmin\site-wide\includes\a_home.inc on line 767[/text]
To do that, I want to get the filesize of each "banner" type image, and then at the bottom, show the filesize overall.
Sounds easy, but it won't let me even get one file size.
I can do it when I run an upload with the ['tmp'] format, but I want to get the filesize like this:
Code: Select all
$path = "/images/pages/$row->image";
echo filesize("$path");[text]Warning: filesize(): stat failed for /images/pages/97242645m27g.jpg in C:\xampp\phpMyAdmin\site-wide\includes\a_home.inc on line 767[/text]