note 23733 added to function.md5-file
| From: | thomas at tnt-computer dot de | Date: | Fri, 26 Jul 2002 09:03:17 +0000 |
| Subject: | note 23733 added to function.md5-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33576@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.
--
http://www.php.net/manual/en/function.md5-file.php
http://master.php.net/manage/user-notes.php?action=edit+23733
http://master.php.net/manage/user-notes.php?action=delete+23733
http://master.php.net/manage/user-notes.php?action=reject+23733