Posted By

jprochazka on 10/02/10


Tagged

FTP


Versions (?)

Send a file via FTP.


 / Published in: PHP
 

A simple example of how to send a file via FTP using PHP.

  1. <?php
  2. $connection = ftp_connect($server);
  3. $login = ftp_login($connection, $ftp_user_name, $ftp_user_pass);
  4. if (!$connection || !$login) { die('Connection attempt failed!'); }
  5. $upload = ftp_put($connection, $dest, $source, $mode);
  6. if (!$upload) { echo 'FTP upload failed!'; }
  7. ftp_close($connection);
  8. ?>

Report this snippet  

You need to login to post a comment.