move_uploaded_file() fails to open stream due to invalid argument - PHP
<p>I have this code to move my uploaded file to a specific directory:</p>

<pre><code>if (isset($_FILES["image"]["name"])){ 
    if (!is_dir('pf/' . $uid)) {
        mkdir('pf/' . $uid);
        $large_image_location = "pf/" . $uid;
    }else {
        $large_image_location = "pf/" . $uid;
    }

    chmod ($large_image_location, 0777);
    move_uploaded_file("$userfile_tmp", "$large_image_location/$userfile_tmp");    

}
</code></pre>

<p>However that gives the following error:</p>

<pre><code>( ! ) Warning: move_uploaded_file(pf/BfyhieniKJGGqTNm/C:\wamp\tmp\phpF08A.tmp) [function.move-uploaded-file]: failed to open stream: Invalid argument in C:\wamp\www\mingle\upload_dp.php on line 26
</code></pre>

<p>Any help on how to sort this out would be greatly appreciated!</p>
