<?php
if(isset($_FILES['upfile']))
{

 $targetfolder = "testupload/";

 $targetfolder = $targetfolder . basename( $_FILES['file']['upfile']) ;

if(move_uploaded_file($_FILES['file']['tmp_name'], $targetfolder))

 {

 echo "The file ". basename( $_FILES['file']['upfile']). " is uploaded";

 }

 else {

 echo "Problem uploading file";

 }

}
 ?>

<html>
   <body>
      
      <form action="" method="POST" enctype="multipart/form-data">
         <input type="file" name="upfile" />
         <input type="submit"/>
      </form>
      
   </body>
</html>