Simple PHP file upload form
Submitted by rac on 31 January, 2008 - 15:19.
Ganz simples Upload script in PHP ohne grosse überprüfungen oder sonstiges...
-
<?php
-
// setze time limit auf unendlich
-
if($_POST["submit"] == "upload"){
-
// Das Formular wurde gesendet
-
if($_FILES['file']['error'] != ) {
-
}
-
// kopiere das temporäre file an den richtigen ort
-
echo "File upload succesful!<br>";
-
echo "Link: <a href=\"" . $_FILES["file"]["name"] . "\">" . $_FILES["file"]["name"] . "</a><br><br>";
-
}
-
else {
-
echo "File upload failed.";
-
}
-
}
-
// Das Formular wird angezeigt
-
?>
-
<form enctype="multipart/form-data" action="<?php echo $PHP_SELF; ?>" method="post">
-
<input name="file" type="file">
-
<input type="submit" name="submit" value="upload">
-
</form>
Trackback URL for this post:
http://www.2030.tk/trackback/152
»
- Download PDF
- Printer-friendly version
- 2096 reads

Post new comment