Datei-Upload-Formular mit PHP verarbeiten

Ich wollte mein Thema nochmal nach oben scrollen .....
Sagt mir bitte mal jemand welchen Stümper-Fehler ich hier mache?
 
PHP:
<?php
error_reporting(E_ALL);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta name="author" content="Burkhard Riedel">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
if(isset($_POST['submit'])) {
$uploaddir = './test/';

echo "<pre>";
if (move_uploaded_file($_FILES['newsbild']['tmp_name'], $uploaddir . $_FILES['newsbild']['name'])) {
   print "File is valid, and was successfully uploaded.  Here's some more debugging info:\n";
   print_r($_FILES);
} else {
   print "Possible file upload attack!  Here's some debugging info:\n";
   print_r($_FILES);
}
echo "</pre>";
}
?>

<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="300000">
Send this file: <input name="newsbild" type="file">
<input type="submit" name="submit" value="Send File">
</form>

</body>
</html>
So müsste es funktionieren, bitte achte darauf, dass deine Pfadangaben mit einem . beginnen, also z. B: "./radioefr" o. ä. Sprich die Ordnerangabe war schlicht und ergreifend falsch :)
 
Zurück