note 57208 added to function.filesize
| From: | socobo at gmail dot com | Date: | Tue, 27 Sep 2005 07:50:55 +0000 |
| Subject: | note 57208 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95858@lists.php.net to get a copy of this message | ||
I've been having trouble trying to get this to work * there is a table that fits around this:
<?php
if ($handle = opendir("plusfiles/$u")) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$size=filesize($file);
echo "<tr class=subtd2 align=center><td
colspan=2>$file</td><td>".date ("F d Y H:i:s",
filemtime("$file"))."</td><td>$size</td></tr>";
}
}
}
?>
And then these are the errors I get.
Warning: filesize(staff_travel.jpg): failed to open stream: No such file or directory in
/home/content/g/a/n/gangwars/html/plus.php on line 99
Warning: filemtime(): Stat failed for staff_travel.jpg (errno=2 - No such file or directory) in
/home/content/g/a/n/gangwars/html/plus.php on line 106
However, what the trouble is - it only works with files that are text based like .css etc..etc..
nothing dynamic like an image loads all I get is the file name. Is there simply something I'm
leaving out because I've built systems like this before and none of them work - could it be a
server error? I'm running Linux.
----
Manual Page -- http://www.php.net/manual/en/function.filesize.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57208
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57208&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57208&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57208&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57208&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57208&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57208&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57208&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57208&report=yes
Search -- http://master.php.net/manage/user-notes.php