title: Uploadify File not being uploaded even after success message
body: <p>I am a newbie at coding I am trying to use uploadify in my website. After uploading the files I get a success message but the file is not being uploaded to the folder. I tried debugging the code with all the answers I found on stackoverflow but nothing seems to work. Here's the code for index.php</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
    &lt;hr&gt;
    &lt;title&gt;Test&lt;/title&gt;
    &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery.uploadify.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;link rel="stylesheet" type="text/css" href="uploadify.css"&gt;
    &lt;style type="text/css"&gt;
      body {
        font: 13px Arial, Helvetica, Sans-serif;
      }
    &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;h1&gt;Uploadify Demo&lt;/h1&gt;
    &lt;form&gt;
      &lt;div id="queue"&gt;&lt;/div&gt;
      &lt;input id="file_upload" name="file_upload" type="file" multiple="true"&gt;
    &lt;/form&gt;
    &lt;?php $timestamp=t ime();?&gt;
    &lt;script type="text/javascript"&gt;
      $(function() {
        $("#file_upload").uploadify({
          'uploader': 'uploadify.swf',
          'cancelImg': 'uploadify-cancel.png',
          'buttonText': 'Browse Files',
          'script': 'uploadify.php',
          'folder': '/uploads',
          'fileDesc': 'Image Files',
          'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
          'queueSizeLimit': 9999,
          'simUploadLimit': 2,
          'sizeLimit': 4000000,
          'checkExisting': false,
          'multi': true,
          'formData': {
            'timestamp': '&lt;?php echo $timestamp;?&gt;',
            'token': '&lt;?php echo md5("unique_salt" . $timestamp);?&gt;'
          },
          'auto': true,
          'onUploadError': function(file, errorCode, errorMsg, errorString) {
            alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
          },
          'onUploadSuccess': function(file, data, response) {
            alert('The file ' + file.name + ' was successfully uploaded with a response of ' /*+ response +*/ + ':' + data);
          },
  
        });
      });
    &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is the uploadify.php file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  // Define a destination
  $targetFolder = '/uploads'; // Relative to the root
  $verifyToken = md5('unique_salt' . $_POST['timestamp']);
  
  if (!empty($_FILES) &amp;&amp; $_POST['token'] == $verifyToken) {
   $tempFile = $_FILES['Filedata']['tmp_name'];
   $targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
   $targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
   
   // Validate the file type
   $fileTypes = array('jpg','JPG','jpeg','JPEG','gif','GIF','png','PNG'); // File extensions
   $fileParts = pathinfo($_FILES['Filedata']['name']);
   
   if (in_array($fileParts['extension'],$fileTypes)) {
    move_uploaded_file($tempFile,$targetFile);
    echo '1';
   } else {
    echo 'Invalid file type.';
   }
  }
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And the check-exists.php file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  /*
  Uploadify
  Copyright (c) 2012 Reactive Apps, Ronnie Garcia
  Released under the MIT License &lt;http://www.opensource.org/licenses/mit-license.php&gt; 
  */
  
  // Define a destination
  $targetFolder = '/uploads'; // Relative to the root and should match the upload folder in the uploader script
  
  if (file_exists($_SERVER['DOCUMENT_ROOT'] . $targetFolder . '/' . $_POST['filename'])) {
   echo 1;
  } else {
   echo 0;
  }
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>PS: I have tried by changing the $targetFolder to uploads, /uploads, /uploads/ but nothing worked.
  The folder has 777 permissions
  The success message I get is "The file ________ was successfully uploaded with a response of :CWSaa"
  I don't know what CWSaa is and how it is echoed.</p>
  
  <p>Please help.</p>