(PHP 4, PHP 5, PHP 7)
ftp_fput — 锟较达拷一锟斤拷锟窖撅拷锟津开碉拷锟侥硷拷锟斤拷 FTP 锟斤拷锟斤拷锟斤拷
$ftp_stream
, string $remote_file
, resource $handle
, int $mode
[, int $startpos
= 0
] ) : boolftp_fput() 锟斤拷锟斤拷锟斤拷锟斤拷锟较达拷一锟斤拷锟斤拷锟窖撅拷锟津开碉拷锟侥硷拷锟叫碉拷锟斤拷锟捷碉拷 FTP 锟斤拷锟斤拷锟斤拷锟斤拷
ftp_stream
FTP 锟斤拷锟接碉拷锟斤拷锟接憋拷识锟斤拷锟斤拷
remote_file
远锟斤拷锟侥硷拷路锟斤拷锟斤拷
handle
锟津开的憋拷锟斤拷锟侥硷拷锟斤拷锟斤拷锟斤拷锟饺★拷锟斤拷募锟侥┪诧拷锟�
mode
锟斤拷锟斤拷模式只锟斤拷为 (锟侥憋拷模式) FTP_ASCII
锟斤拷
(锟斤拷锟斤拷锟斤拷模式) FTP_BINARY
锟斤拷锟叫碉拷一锟斤拷锟斤拷
startpos
远锟斤拷锟侥硷拷锟较达拷锟侥匡拷始位锟矫★拷
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
Example #1 ftp_fput() 锟斤拷锟斤拷
<?php
// open some file for reading
$file = 'somefile.txt';
$fp = fopen($file, 'r');
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// try to upload $file
if (ftp_fput($conn_id, $file, $fp, FTP_ASCII)) {
echo "Successfully uploaded $file\n";
} else {
echo "There was a problem while uploading $file\n";
}
// close the connection and the file handler
ftp_close($conn_id);
fclose($fp);
?>
锟芥本 | 说锟斤拷 |
---|---|
4.3.0 |
锟斤拷锟斤拷锟� startpos 锟斤拷支锟街★拷
|