title: PHP ftp_get Permission denied
body: <p>Im new in PHP and I'm using this code to download a image from a ftp to my Desktop:</p>
  
  <pre><code>    // try to login
  if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
      echo "&lt;p&gt; Connected as " . $ftp_user . " " . $ftp_server . "&lt;/p&gt;";
  } else {
      echo "&lt;p&gt; Couldn't connect as" . $ftp_user . "&lt;/p&gt;";
  }
  
  $local_file = "C:\Users\sam\Desktop";
  $server_file = "ftp://md346645@188.93.148.30/public/sites/www.ronvanderwerf.com/Images/beeld.jpg";
  
  // download server file
  if (ftp_get( $conn_id, $local_file, $server_file, FTP_ASCII))
  {
      echo "Successfully written to $local_file.";
  }
  else
  {
      echo "Error downloading $server_file.";
  }
  </code></pre>
  
  <p>I am running this code on XAMPP. Unfortunately, this is what I get:</p>
  
  <pre class="lang-none prettyprint-override"><code>*Connected as md346645 188.93.148.30*
  
  *Warning: ftp_get(C:\Users\sam\Desktop): failed to open stream: Permission denied in C:\xampp\htdocs\Website ron\index.php on line 34*
  
  *Warning: ftp_get(): Error opening C:\Users\sam\Pictures in C:\xampp\htdocs\Website ron\index.php on line 34*
  *Error downloading ...md346645@188.93.148.30/public/sites/www.ronvanderwerf.com/Images/beeld.jpg.*
  </code></pre>
  
  <p>It seems to me that I have to chmod my <code>$local_file</code> to give permission. Unfortunately I did not succeed to accomplish that.</p>
  
  <p>Does anyone have any ideas?</p>