title: php chmod() not changing permissions
body: <p>I am having problems with a picture uploading script.</p>
  
  <p>I know there are hundreds of the same questions, but I haven't found the one that would be work for me.</p>
  
  <pre><code>$upload_dir = "images/postcards/";
  chmod($upload_dir, 777);
  if (is_writable($upload_dir)) {
      echo 'The file is writable';
  } else {
      echo 'The file is not writable';
  }
  </code></pre>
  
  <p>This always returns that the file is "not writable"</p>
  
  <p>I tried setting <code>chmod</code> to <code>0777</code> and <code>-rwxrwxrwx</code>. But result was always the same. Any Ideas?</p>