Let's say we have an image file stored on a remote server (for example, let this image ), how can we determine (in PHP code) this file size?
If the file was on the server, we would use filesize ( see here ), but this would not work in the remote file ( see here ).
Another option is to check the "Content-Length", but I believe that it will not work for the image file ( see here )
I would like to get a solution like the one listed here (for example, something like:
<?php
function get_remote_size($url) {
}
echo get_remote_size("http://humus101.com/wp-content/uploads/2009/11/Hummus-soup.jpg");
?>
But without the need to upload an image. Is it possible?
source
share