title: File upload using ftp_fput not working in case of image
body: <p>I have tried file upload to server using ftp connection in php and it works fine for html file but in case of images, directories are created but no image will be upload in this directories....i have tried following code please help by correcting it</p>
  
  <pre><code>$conn_id = ftp_connect($ftp_server);
  $login_result = ftp_login($conn_id, $ftp_username, $ftp_password);
  ftp_pasv($conn_id, true);
  
  $my_file = "PATH_TO_FILE";
  
  $fp = fopen($my_file, "r");
  
  if (ftp_fput($conn_id, $my_file , $fp , FTP_BINARY)) {
      echo "Successfully uploaded \n";
  } else {
         echo "There was a problem while uploading \n";
  }
  
  fclose($fp);
  ftp_close($conn_id);
  </code></pre>