Hi, i am an asp.net developer but recently had to switch to php to design a website for a friend, i am currently trying out the file upload but keep on getting errors.
error: Undefined index
I've tried soo many scripts online but none work, so could you please here me out.

<form action="getfile.php" method="post" enctype="multipart/form-data>
<input type="file" name="uploadedFile" >
<input type="submit" value="Upload File">
echo $_FILES['uploadedFile']['name'];
if( $_FILES['uploadedFile']['name'] != "" )
   copy( $_FILES['uploadedFile']['name'], "uploads/" ) or 
           die( "Could not copy file!");
    die("No file specified!");
i tried this too:
$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";