How do I allow users to choose where to upload the file?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/11379813/how-do-i-allow-users-to-chose-where-to-upload-the-file">How do I allow users to chose where to upload the file?</a>  </p>
</blockquote>



<p>I want to allow my users to chose where to upload their files. If anyone could help me, that'd be great.</p>

<p>uploader.html
<a href="http://pastebin.com/LQP9jxLH" rel="nofollow">http://pastebin.com/LQP9jxLH</a></p>

<pre><code>&lt;div id="main"&gt;
&lt;center&gt;&lt;h2&gt;File Uploader Beta&lt;/h2&gt;&lt;/center&gt;&lt;br /&gt;
&lt;center&gt;
&lt;form action="upload.php" method="post" enctype="multipart/form-data"&gt;
File: &lt;input type="file" name="filename" /&gt;
&lt;input type="submit" value="Upload" /&gt;
&lt;/form&gt;
&lt;/center&gt;
&lt;/div&gt;
</code></pre>

<p>upload.php
<a href="http://pastebin.com/CtM1LW13" rel="nofollow">http://pastebin.com/CtM1LW13</a></p>

<pre><code>$folder = "files/";
$HTTP_POST_FILES = "";
if(isset($_FILES['filename']['tmp_name'])) // Check if $_FILES['filename']['tmp_name'] is there
{
        if (is_uploaded_file($_FILES['filename']['tmp_name']))  {  
                if (move_uploaded_file($_FILES['filename']['tmp_name'], $folder.$_FILES['filename']['name'])) {
                        Echo "Your file has been uploaded! You should probably tell Cody what you uploaded so he can get it in the right place. :)";
                } else {
                        Echo "Haha! You don't have access to do that.";
        }
        } else {
                Echo "Your upload has failed.";
        }
}
</code></pre>

<p>All help is appreciated. :)</p>

<p>Also, I need it to generate a script into the page once the file has uploaded.
Say, if example.jpg was uploaded to /Cody/Pictures.
It would delete <h1>No files were found..</h1>
and replace it with:
File Name: $FileName
Download: </p>

<p>Can anyone do that? Thanks if you can!</p>
