Your uploading code is not correct, see example:
=$_FILES[='.basename($filename));
header("Content-Type: application/octet-stream");
header("Content-Transfer-Encoding: binary");
header('
<html>
<body>
<form method="post" enctype="multipart/form-data" action="download.php">
<input type="file" name="file" >
<input type="submit" name="download" value="download">
</form>
</body>
</html>
Note the extra attributes in the <form> tag, and the use of $_FILES not $POST to capture the file object in php. PHP will give the upload file a temporary file name called $_FILES['file']['tmp_name'] which will disappear when the script ends.
Read more:
1.
php_file_upload[
^]
2.
Beginner's Guide to HTML5 & CSS3 - Server Side Story[
^]