i've been googleing but all i get is getimagesize and filesize.
getimagesize dosent get the KB size just width and height which is not what im looking for.
filesize give me the message Warning: filesize() [function.filesize]: stat failed for
the file in question is 51kb .jpg file
$imgsize=filesize("http://localhost/projects/site/schwe/user/1/1.jpg");
does not work,
how do i accomplish this?
PHP | imageresolution() Function. The imageresolution() function is an inbuilt function in PHP which is used to set and return the resolution of an image in DPI (dots per inch). If none of the optional parameters is given, the current resolution is returned as an indexed array.
The Imagick::getImageProperties() function is an inbuilt function in PHP which is used to get the image properties.
You cannot get file size of remote elements, either give a relative path on your system OR do a file_get_contents()
to get contents first
. Thus, instead of http:// , do a filesize('/path/to/local/system')
. Make sure its readable by php process
You can't look up the filesize of a remote file like that. It is meant for looking at the filesize of local files.
For instance...
$imgsize = filesize( '/home/projects/site/1.jpg' );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With