Jump to content

Getting Image size With no Upload?


Monkuar

Recommended Posts

Here's kind of a hack way to do it.  There might be a better way:

$content = file_get_contents("http://www.example.com/path/to/image.jpg"); 

$handle = fopen("image.jpg", "w+"); 
fwrite($handle, $content); 
fclose($handle); 

$size = filesize('image.jpg');

 

In short, you are probably going to have to download the file, at least temporarily, to get the file size.  You can always delete it right after.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.