note 23733 deleted from function.md5-file by dams
| From: | dams@php.net | Date: | Tue, 30 Jul 2002 00:46:48 +0000 |
| Subject: | note 23733 deleted from function.md5-file by dams | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-33943@lists.php.net to get a copy of this message | ||
You don't even need to know the files size. Just fread 1024 Byte blocks:
function md5_remote_file($filename){
$remote = @fopen($filename, "rb");
if($remote) {
while($buf = fread($remote, 1024)) {
$content .= $buf;
}
fclose($remote);
return md5($content);
}
return false;
}
You have to store a file localy to determine it's filesize.