Code :
- <?php
- $server = "a1394.g.akamai.net";
- $file = "/7/1394/3235/v007/webdownload2.intervideo.com/windvdplatinum/p001/Enu/WinDVDPlatinum.exe";
- $fs = @fsockopen($server, 80, $errno, $errstr, 15);
- @fputs($fs, "HEAD $file HTTP/1.0\r\n" );
- @fputs($fs, "Connection: close\r\n\r\n" );
- while ($line = @fgets($fs,1024))
- {
- if (substr($line, 0, 16) == "Content-Length: " )
- {
- $filesize = trim(substr($line, 16));
- @fclose($fs);
- break;
- }
- }
- echo "The file is $filesize bytes long";
- ?>
|