title: chmod() a directory on localhost
body: <p>I'm currently trying out an upload form for .csv files on localhost, however I haven't been able to upload a file with it yet. This is because I need to chmod a directory on localhost. Currently I'm using this:</p>
  
  <pre><code>$allowed_filetypes = array('.csv');
  $max_filesize = 524288;
  $upload_path = '/csvfiles/';
  
  $filename = $_FILES['userfile']['name'];
  
  // Check if we can upload to the specified path, if not DIE and inform the user.
  
  if(!is_writable($upload_path)){
   $chmod = chmod ($upload_path &amp; "/" &amp; $_FILES, 777);
  
   // Upload the file to your specified path.
   if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename)){
      echo 'Upload succesful';
      }else{
      echo 'There was an error during the file upload.  Please try again. :('; // It failed :(.
           }
      } else
      die ('You cannot upload to the specified directory, please CHMOD the directory.');
  </code></pre>
  
  <p>I'm not sure what this line of code needs to be:</p>
  
  <pre><code>$chmod = chmod ($upload_path &amp; "/" &amp; $_FILES, 777);
  </code></pre>
  
  <p>My script keeps dying, and nothing happens to the directory.</p>
  
  <p>Also, if you have experience with these kind of things, feel free to debug! :D</p>
  
  <pre><code>Side note: My OS is RHEL5
  </code></pre>
  
  <p>Thanks in advance,</p>
  
  <p>-Max</p>