title: PHP ftp_put warning Warning: ftp_put() [function.ftp-put]: Type set to I. in
body: <p>When i try to upload files using PHP's ftp_put function, earlier it was erroring:</p>
  
  <p><code>Warning: ftp_put() [function.ftp-put]: No data connection</code></p>
  
  <p>Now, i tried to put passive mode on: </p>
  
  <p><code>ftp_pasv($conn_id, true);</code></p>
  
  <p>then comes error:</p>
  
  <p><code>Warning: ftp_put() [function.ftp-put]: Type set to I. in</code></p>
  
  <p>ftp_login is done properly and it says Successfully.</p>
  
  <p>Now it gives new warning: Warning: <code>ftp_put() [function.ftp-put]: abc.txt: Cannot open or remove a file containing a running program.</code></p>
  
  <p>Any ideas, why file not tranferring ? </p>
  
  <p>Thanks !</p>
  
  <p>Here is my code snippet:</p>
  
  <pre><code>    $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
  
      $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass) or die("You do not have access to this ftp server!");
  
      if ((!$conn_id) || (!$login_result)) {
          // wont ever hit this, b/c of the die call on ftp_login
          echo "&lt;span style='color:#FF0000'&gt;&lt;h2&gt;FTP connection has failed! &lt;br /&gt;";
          echo "Attempted to connect to $ftp_server for user $ftp_user_name&lt;/h2&gt;&lt;/span&gt;";
          exit;
      } else {
          //echo "Connected to $ftp_server, for user $ftp_user_name &lt;br /&gt;";
      }
  
      //turn passive mode on
      ftp_pasv($conn_id, true);
  
      $upload = ftp_put($conn_id, $destination_file.$name, $filename, FTP_BINARY);
  
      if (!$upload) {
          echo "&lt;span style='color:#FF0000'&gt;&lt;h2&gt;FTP upload of $filename has failed!&lt;/h2&gt;&lt;/span&gt; &lt;br /&gt;";
      } else {
          echo 'Uploaded';    
      }
  
   ftp_close($conn_id);
  </code></pre>