Re: picking files (server side) - need help please
| From: | David Elliott | Date: | Tue, 22 Oct 2002 14:46:47 +0000 |
| Subject: | Re: picking files (server side) - need help please | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16471@lists.php.net to get a copy of this message | ||
Hi Aidal
On 22 October 2002 at 15:07:04 +0200 (which was 14:07 where I live) Aidal
graced us with these comments
< ... >
> I browse my own PC for files.
well you can not browse for them.
< ... >
> Assuming that those pictures have already been uploaded to a certain dir on
> the web server, can this be done and if so how would one do this?
Have a look at the code below it might give you a clue.
==========8<=============================================================
<table summary="file list" border="1" align="center">
<?php
$handle=opendir('.');
while ($file = readdir( $handle))
if( $file != ".." && $file != "." && $file !=
"index.php")
{
echo "<tr>\n<td>\n<a
href='$file'>$file</a></td>\n".
"<td align='center'>".sprintf( '%1.3f', filesize( $file)
/ (1024*1024)).
" Mb</td>\n".
"<td align='right'>\n".date('d-m-Y
H:i',filemtime($file))."</td>\n</tr>\n";
}
closedir( $handle);
?>
</table>
==========8<=============================================================
--
Bye, _______________________________________________
David | David Elliott | Software Engineer |
_________________________| list@elliott.uk.com | PGP Key ID 0x650F4534 |
| Respect, bah! It's more fun to make people afraid. |