Porsche_maniak
Established Member
CLOSED...
function ffilesize($file){
$ch = curl_init($file);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
$data = curl_exec($ch);
curl_close($ch);
if ($data === false)
return false;
if (preg_match('/Content-Length: (\d+)/', $data, $matches)) {
return (float)$matches[1];
}
elseif (preg_match('/content-length: (\d+)/', $data, $matches)) {
return (float)$matches[1];
}
}
Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.