You are here:Home » php » php simple file upload script

php simple file upload script

<!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

'; exit; } } ?>
Please choose a file:
0) {echo "Error: " . $_FILES["file"]["error"] . "
";} else {echo "Stored file:".$_FILES["file"]["name"]."
Size:".($_FILES["file"]["size"]/1024)." kB
"; move_uploaded_file($_FILES["file"]["tmp_name"],$_FILES["file"]["name"]); } } // open this directory $myDirectory = opendir("."); // get each entry while($entryName = readdir($myDirectory)) {$dirArray[] = $entryName;} closedir($myDirectory); $indexCount = count($dirArray); echo "$indexCount files
"; sort($dirArray); echo "
\n"; for($index=0; $index < $indexCount; $index++) { if (substr("$dirArray[$index]", 0, 1) != ".") { echo ""; } } echo " "; ?>
Post a Comment