0

I have tried many things including this but i can't figure out why i'm not getting it's file size.

echo remotefileSize("http://iristech.co/download/277/");

function remotefileSize($url) 
{
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_NOBODY, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_MAXREDIRS, 3);
    curl_exec($ch);
    $filesize = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
    curl_close($ch);
    if ($filesize) return $filesize;
}
Matt
  • 12,848
  • 2
  • 31
  • 53
m.qayyum
  • 401
  • 2
  • 15
  • 44

1 Answers1

1

I'm the creator of Iris. The software from the link you use. It doesn't work, because this is not a link to a file. It's link to a script, which links to a file. Try with different file or upload the file on your hosting :)

Daniel Georgiev
  • 1,292
  • 16
  • 14