ftp_nb_fput()

It stores a file from an open file to the FTP server

Example

<?php

$fp = fopen(“test.txt”, ‘w’);

$ftpId = ftp_connect(‘ftp.phpcodez.com’);

$login = ftp_login($ftpId, ‘anonymous’, ‘user@phpcodez.com’);

$dest = ftp_nb_fput($conn_id, “text.txt”, $fp, FTP_BINARY);

while ($dest == FTP_MOREDATA) {

  $dest = ftp_nb_continue($ftpId);

}

  ftp_close($ftpId);

  fclose($fp);

?>

Share