Mailinglisten-Archive |
Hallo,
ich beziehe mich bei dieser Datei auf ein Buchbeispiel. Hierbei kriege
ich folgende Meldung:
*Warning*: readdir(): supplied argument is not a valid Directory
resource in */home/www/htdocs/isorast24.de/upload.php* on line *38
*In Zeile 38 beginnt folgende Schleife:
while($file = readdir($dp)){
if(!preg_match('/^\.{1,2}/', $file)){
echo $file;
echo ' (' . filesize("upload/$file") . 'Byte)';
echo '<br />';
}
}
Der gesamte Quellcode sieht wie folgt aus:
<body>
<form enctype="multipart/form-data" action="<?php echo $PHP_SELF; ?>"
method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
</body>
<?php
if(isset($upload)){
echo '<b>Informationen zur aktuellen Datei:</b><br />';
echo $HTTP_POST_FILES['userfile']['name'].'<br />';
echo $HTTP_POST_FILES['userfile']['size']. 'Byte<br />';
echo $HTTP_POST_FILES['userfile']['type']. '<br />';
$path = dirname($PATH_TRANSLATED). './upload/';
copy($userfile, $path.$userfile_name);
}
$dp = opendir($path);
echo '<hr noshade size="2">';
while($file = readdir($dp)){
if(!preg_match('/^\.{1,2}/', $file)){
echo $file;
echo ' (' . filesize("upload/$file") . 'Byte)';
echo '<br />';
}
}
?>
</html>
Im Ordner "upload" landet nichts.
Gruß, Ingo
php::bar PHP Wiki - Listenarchive