title: Uploadify and PHP move files issue
body: <p>I have created a script that will upload files to a general uploads folder, the upload works fine however when I try to get the script to move the files from the temp folder to the uploads folder. I get the following issue. </p>
  
  <pre><code>[23-Mar-2012 18:57:21 UTC] PHP Warning:  move_uploaded_file(): Unable to move '/var/tmp/php3O42Kn' to '/home3/***/***/***/MAINFOLDER/uploads/itworks/' in /home3/***/***/***/MAINFOLDER/admin/uploader.php on line 21
  </code></pre>
  
  <p>When I had the uploads folder in the same directory as the <code>uploader.php</code> script it was working, however I placed my <code>uploader.php</code> script in the <code>/admin</code> folder while keeping the <code>/uploads</code> in the root folder. Below is the script I am using.</p>
  
  <p><strong>uploader.php</strong> (main/admin)</p>
  
  <pre><code>  &lt;?php
  
      if (!empty($_FILES)) {
          $tempFile = $_FILES['Filedata']['tmp_name'];
  
  
          $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
          $targetFile =  str_replace('//','/',$targetPath) . $filename;
  
  
          // $fileTypes  = str_replace('*.','',$_REQUEST['fileext']);
          // $fileTypes  = str_replace(';','|',$fileTypes);
          // $typesArray = split('\|',$fileTypes);
          // $fileParts  = pathinfo($_FILES['Filedata']['name']);
  
          // if (in_array($fileParts['extension'],$typesArray)) {
                  if (!file_exists($targetPath)) {  
                       mkdir(str_replace('//','/',$targetPath), 0755, true);  
                  }
  
              move_uploaded_file($tempFile,$targetFile);
              echo str_replace($_SERVER['DOCUMENT_ROOT'],'',$targetFile);
          // } else {
          //  echo 'Invalid file type.';
          // }
      }
      ?&gt;
  </code></pre>
  
  <p><strong>upload.php</strong> (main/admin)</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
      $(document).ready(function() {
          $("#file_upload").uploadify({
              'uploader'     : 'includes/uploadify.swf',
              'script'         : 'uploadify.php',
              'folder'         : '../uploads',
              'cancelImg'      : 'includes/images/cancel.png',
              'multi'          : true,
              'auto'           : false,
              'fileTypeExts'        : '*.jpg;*.gif;*.png',
              'fileTypeDesc'       : 'Image Files (.JPG, .GIF, .PNG)',
              'queueID'        : 'custom-queue',
              'queueSizeLimit' : 10,
              'simUploadLimit' : 3,
              'sizeLimit'   : 10240000,
              'removeCompleted': true,
              'onAllComplete'  : function(stats) {
                  $('#status-message').text(data.filesUploaded + ' files uploaded, ' + data.errors + ' errors.');
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I think the issue is here: <code>'folder'         : '../uploads',</code>. Idealy I want the uploader.php file to automatically push the directory back one level however all my methods seem not to have worked.</p>
  
  <p>Many thanks to anyone who could help me shed some light on this! </p>