PHP:
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Dateiupload</title>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
if(isset($_POST['submit'])) {
$uploaddir = './htdocs/pics/';
$uploadfile = $uploaddir.basename($_FILES['newsbild']['name']);
echo "<pre>";
//if(move_uploaded_file($_FILES['newsbild']['tmp_name'], $uploadfile)){
if (is_uploaded_file($_FILES['newsbild']['tmp_name'])) {
echo "Datei ". $_FILES['newsbild']['name']." erfolgreich upgeloadet.\n";
echo "Anzeige des Inhalts". $_FILES['newsbild']['tmp_name'] ."\n";
print_r($_FILES);
}
else {
echo "<br>Mögliche Dateiupload-Attacke: ";
echo "Dateiname '". $_FILES['newsbild']['tmp_name'] . "'.";
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>
Ich bin mit meinem Latein am Ende!