Here's a function for parsing remote file information for file size. It returns file size if it can, otherwise it returns 0.
funtion get_file_size ($url)
{
$url = parse_url($url);
$fp = fosckopen($url[host],80,$errno,$errstr,30);
socket_set_blocking($fp, TRUE);
// Can't open a connection //
if (! $fp) { return 0; }
fwrite($fp, "HEAD $url[path] HTTP/1.0\r\nHost: $url[host]\r\n\r\n");
fclose($fp);
preg_match("/content-length:\s?(\d+)/i", $result, $match);
return $match[1];
}