Unable to Upload the file using Uploadify script
<p>I am using the Uploadify Plugin to Upload files. although this might be a very basic question i am unable to understand and implement to get it work to upload the files. </p>

<p>I want to achieve the following using uploadify</p>

<p>when a user select the file i want it to be directly uploaded to the target path using PHP.</p>

<p>now i am using the following code.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;link rel="stylesheet" href="css/uploadify.css" type="text/css" /&gt;
&lt;script type="text/javascript" src="js/jquery-1.3.2.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/jquery.uploadify.v2.1.0.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/swfobject.js"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;script type="text/javascript"&gt;
$(document).ready(function() {
    $('#someID').uploadify({ 
      'uploader': 'img/uploadify.swf',
      'script': 'uploadify.php',
      'folder': 'upload',
      'cancelImg': 'img/cancel.png',
      'auto': 'true',
      'fileDesc': 'jpg/jpeg',
      'displayData': 'percentage',
      'fileExt': "*.jpg;*.jpeg",
      'sizeLimit' : '8388608'
      }); }); 
      &lt;/script&gt;

&lt;body&gt;
&lt;form id="someID" action="uploadify.php" method="post" enctype="multipart/form-data"&gt; 
&lt;input type="file" name="file" id="fileUpload1"/&gt;
&lt;p&gt;&lt;input type="submit" name="submit" value="Upload" /&gt;&lt;/p&gt; 
&lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p>and this is the code for uploadify.php </p>

<pre><code>if (!empty($_FILES)) {
    $tempFile = $_FILES['file']['tmp_name'];
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
    $targetFile =  str_replace('//','/',$targetPath) . $_FILES['file']['name'];
    move_uploaded_file($tempFile,$targetFile);
        echo "1";
</code></pre>

<p>I just want to upload a single file. do i need to include the check.php for that. how do i make something like when a user select the image file it directly performs the operation and move to the designated directory. </p>

<p>P.S: I have the very basic understanding of javascript and jquery. :)</p>

<p>Note : file uploading problem is solved now. </p>

<blockquote>
  <p>how do i limit the user from uploading
  just one file on one button, i want
  something like when  a user select the
  file and it gets uploaded that button
  should be disabled or something</p>
</blockquote>

<p>EDIT : for limiting the users from uploading multiple file in a button i added this code and it is still uploading many files as and when users select multiple times. here is my code.</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function() {
    $('#someID').uploadify({ 
      'uploader': 'img/uploadify.swf',
      'script': 'uploadify.php',
      'folder': 'upload',
      'cancelImg': 'img/cancel.png',
      'auto': 'true',
      'fileDesc': 'jpg/jpeg',
      'displayData': 'percentage',
      'fileExt': "*.jpg;*.jpeg",
      'sizeLimit' : '8388608',
      'fileDataName' : 'file',
      onSelect : function(){
           $("#someID input").attr("disabled", true);
      }
      }); }); 
      &lt;/script&gt;
</code></pre>

<p>what is wrong with it?</p>
