jquery PHP image upload (using .post method)
<p>I am trying to upload images on a form but I am using Jquery .Post function in order to submit the data of the form. I get a PHP error of an undifined index. Here is  a small portion of my code:</p>

<p>related HTML:</p>

<pre><code>&lt;input type="hidden" name="MAX_FILE_SIZE" value="1000000" /&gt;
Picture: &lt;input name="uploadedfile" id="uploadedfile" type="file" /&gt;
</code></pre>

<p>related jQuery</p>

<pre><code>    $.post("registerCB.php", {
    uploadedfile: $("#uploadedfile").val()
}
</code></pre>

<p>The PHP that handles the submission: </p>

<pre><code>//file upload
        $uploadedfile= $_POST["uploadedfile"];



        /*--------------------Image Uploads-------------------------*/
        // Where the file is going to be placed 
        $target_path = "userImages/";

        /* Add the original filename to our target path.  
        Result is "uploads/filename.extension" */
        $target_path = $target_path . basename( $_FILES[$uploadedfile]['name']); 
</code></pre>

<p>THE ERROR:
<img src="http://i.stack.imgur.com/6ySdI.png" alt="enter image description here"></p>

<p>CONCLUSION:
I think the issue is the .val() on the image input. I did an alert on that element and it would only alert the file name NOT the entire path. </p>

<p>How can I get the entire path?</p>

<p>ONE MORE THING----
I would like to control the NAME of the file. So no matter what the user uploads I can control the name....is this possible?</p>

<p>THANKS!!!</p>
