note 92824 modified in function.ftp-nb-put by danbrown
| From: | danbrown@php.net | Date: | Tue, 11 Aug 2009 15:20:38 +0000 |
| Subject: | note 92824 modified in function.ftp-nb-put by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159329@lists.php.net to get a copy of this message | ||
How to realize the possibility of transferring data from one FTP-server to another via FXP:
<?php
// ...
$ansver = ftp_raw($ftp_conn1, 'PASV');
if (intval($ansver[0]) == 227) {
ftp_raw($ftp_conn2, 'PORT '.substr($ansver[0], $n = strpos($ansver[0], '(') +
1, strpos($m[0], ')', $n) - $n));
ftp_raw($ftp_conn1, 'STOR '.$filename); // need asynchronously (non-blocking)
ftp_raw($ftp_conn2, 'RETR '.$filename);
}
?>
--was--
How to realize the possibility of transferring data from one FTP-server to another via FXP?
<?php
// ...
$ansver = ftp_raw($ftp_conn1, 'PASV');
if (intval($ansver[0]) == 227) {
ftp_raw($ftp_conn2, 'PORT '.substr($ansver[0], $n = strpos($ansver[0], '(') +
1, strpos($m[0], ')', $n) - $n));
ftp_raw($ftp_conn1, 'STOR '.$filename); // need asynchronously (non-blocking)
ftp_raw($ftp_conn2, 'RETR '.$filename);
}
?>
http://php.net/manual/en/function.ftp-nb-put.php