(PHP 4 >= 4.3.0, PHP 5, PHP 7)
ftp_nb_put — 锟芥储一锟斤拷锟侥硷拷锟斤拷 FTP 锟斤拷锟斤拷锟斤拷锟斤拷non-blocking锟斤拷
$ftp_stream
, string $remote_file
, string $local_file
, int $mode
[, int $startpos
] ) : int
ftp_nb_put() 锟斤拷锟斤拷锟斤拷锟斤拷锟窖憋拷锟斤拷锟侥硷拷 local_file
锟芥储锟斤拷 FTP 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 remote_file
锟斤拷锟斤拷指锟斤拷锟斤拷路锟斤拷锟斤拷锟斤拷锟斤拷模式锟斤拷锟斤拷
mode
只锟斤拷为 FTP_ASCII
(锟侥憋拷模式) 锟斤拷 FTP_BINARY
(锟斤拷锟斤拷锟斤拷模式) 锟斤拷锟街★拷锟诫函锟斤拷 ftp_put()
锟斤拷同锟斤拷锟角o拷锟剿猴拷锟斤拷锟较达拷锟侥硷拷锟斤拷时锟斤拷锟斤拷玫锟斤拷锟斤拷觳斤拷锟斤拷锟侥J斤拷锟揭诧拷锟斤拷锟轿讹拷锟斤拷锟斤拷募锟斤拷锟斤拷偷墓锟斤拷锟斤拷校锟斤拷锟侥筹拷锟斤拷锟斤拷约锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷椤�
锟斤拷锟斤拷 FTP_FAILED
锟斤拷FTP_FINISHED
锟斤拷 FTP_MOREDATA
锟斤拷
Example #1 ftp_nb_put() 实锟斤拷
<?php
// 锟斤拷始锟较达拷
$ret = ftp_nb_put($my_connection, "test.remote", "test.local", FTP_BINARY);
while ($ret == FTP_MOREDATA) {
// 锟斤拷锟斤拷锟斤拷锟斤拷约锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟�
echo ".";
// 锟斤拷锟斤拷锟斤拷锟斤拷...
$ret = ftp_nb_continue ($my_connection);
}
if ($ret != FTP_FINISHED) {
echo "锟较达拷锟侥硷拷锟叫凤拷锟斤拷锟斤拷锟斤拷...";
exit(1);
}
?>
Example #2 使锟斤拷 ftp_nb_put() 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
<?php
// 锟斤拷始
$ret = ftp_nb_put ($my_connection, "test.remote", "test.local",
FTP_BINARY, ftp_size("test.remote"));
// 锟斤拷: $ret = ftp_nb_put ($my_connection, "test.remote", "test.local",
// FTP_BINARY, FTP_AUTORESUME);
while ($ret == FTP_MOREDATA) {
// 锟斤拷锟斤拷锟斤拷锟斤拷要执锟叫的达拷锟斤拷
echo ".";
// 锟斤拷锟斤拷锟斤拷锟斤拷...
$ret = ftp_nb_continue ($my_connection);
}
if ($ret != FTP_FINISHED) {
echo "锟较达拷锟侥硷拷锟叫凤拷锟斤拷锟斤拷锟斤拷...";
exit(1);
}
?>
锟轿硷拷 ftp_nb_fput()锟斤拷ftp_nb_continue()锟斤拷ftp_put() 锟斤拷 ftp_fput()锟斤拷