You need to to use $_FILES['UploadedPic']['tmp_name']
which is the actual file location in the tmp folder not $_FILES["UploadedPic"]["name"]
which is just the name of the file.
Also you need to check that the upload went ok, because there are possible reasons the upload could fail:
$uploaddir = 'uploads/';
// Check for upload attempt
if(isset($_FILES['UploadedPic'])){
//$newfile = $uploaddir.basename($_FILES['UploadedPic']['name']);
$newfile = $uploaddir.'temp.png';
// If no error
if($_FILES['UploadedPic']['error'] == 0){
//Attempt to move
if (move_uploaded_file($_FILES['UploadedPic']['tmp_name'], $newfile)) {
echo "File was successfully uploaded.";
}else{
echo 'Error moving file.';
}
} else {
// Has error
$errors = array(
0=>"There is no error, the file uploaded with success",
1=>"The uploaded file exceeds the upload_max_filesize directive in php.ini",
2=>"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form",
3=>"The uploaded file was only partially uploaded",
4=>"No file was uploaded",
6=>"Missing a temporary folder"
);
echo "Error: ".$errors[$_FILES['UploadedPic']['error']];
}
}
Also you might want to look into checking the upload is actually an image with getimagesize()
Hope it helps good luck.