<?php- $action = $_POST["action"];
- $max_size = "1048576";
- echo "
- <b>Uploader</b><br>
- <form action='upload.php' method=post enctype='multipart/form-data'>
- File (max size: $max_size bytes/".($max_size/1024)." kb):<br>
- <input type='file' name='filename'><br>
- <input type='hidden' name='action' value='upload'>
- <input type='submit' value='Upload File'>
- </form>";
- if ($action == 'upload')
- {
-
-
- if ($_FILES["filename"]["size"] > $max_size) die ("<b>File too big! Try again...</b>");
-
-
- copy($_FILES["filename"]["tmp_name"],"./".$_FILES["filename"]["name"]) or die("<b>Unknown error!</b>");
- echo "<b>File Uploaded.</b>";
-
-
- }
-
- ?>
Kembangin ndiri bro
Thanks to: DNZ (codenesia.)