fopen ; fstat
| From: | Mister16 | Date: | Mon, 19 Nov 2001 17:43:50 +0000 |
| Subject: | fopen ; fstat | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-14443@lists.php.net to get a copy of this message | ||
Hi everybody!!
Does anybody know how to use fopen and fstat!
I used it on local files and refered files on the own server, but it doesn't
show (e.g. the filesize) of my server with the downloadfiles, which is not
the same server the php files are on!
I've also added the source code, so please help me if you can!!
Thanx!!
Mister16
<?php
$file = fopen ("http://www.ganymede.spaceports.com/~mister16/2inseln.exe",
"r"); echo "Datei geladen!!<br>";
$t=fstat($file); echo "Array über Funktion zugewiesen<br>";
print $t["size"]; echo "Info ausgegeben!<br>";
fclose ($file); echo "Datei geschlossen!<br>";
/*if ($t >= 1000000) {
$t = $t / 1000000;
$t = round($t,3);
echo "$t MB";
}
elseif ($t >= 1000) {
$t = $t / 1000;
$t = round($t,3);
echo "$t KB";
}
else {
$t = round($t,3);
echo "$t Byte(s)";
};*/
?>