Richie: upload

Beitrag lesen

warum funktioniert das nicht?

<?
while(list($key,$val)=each($_POST))
{
$$key=$val;
}
while(list($key,$val)=each($_GET))
{
$$key=$val;
}
$PHP_SELF=$_SERVER["PHP_SELF"];
?>

<html>
<head>
<title></title>
</head>
<body>

<embed src="http://itchydiemaus.milten.lima-city.de/newfile.mp3" width="200" height="40" autostart="false">

<br>

<form
  action="<?php echo $_SERVER['PHP_SELF']; ?>"
  method="post"
  enctype="multipart/form-data">
<input type="file" name="probe" />
<input type="submit" value="Los!" />
</form>
<hr />
<?php
  if (isset($_FILES['probe']) and ! $_FILES['probe']['error']) {
    // Alternativ:            and   $_FILES['probe']['size']
    move_uploaded_file($_FILES['probe']['tmp_name'], "./newfile.mp3");
    printf("Die Datei %s steht jetzt als " .
          "newfile.txt zur Verfügung.<br />\n",
      $_FILES['probe']['name']);
    printf("Sie ist %u Bytes groß und vom Typ %s.<br />\n",
      $_FILES['probe']['size'], $_FILES['probe']['type']);
  }
?>
</body>
</html>