<?php
$uploaddir = '../../uploads/tmp/'.$_POST["location"]."/";
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
echo $uploadfile;
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
  echo "File is valid, and was successfully uploaded.\n";
} else {
  echo "Possible file upload attack!\n";
}