Jump to content

[SOLVED] Reading filesize of a file


Porl123

Recommended Posts

I would use this:

 

<?php
$url = 'URL here';
$headers = get_headers($url, 1);
$filesize = $headers['Content-Length'];
?>

Requires PHP 5. Else file_get_contents() can be used:

 

<?php
$url = 'URL here';
$filesize = strlen(file_get_contents($url));
?>

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.