ftp_put

(PHP 3>= 3.0.13, PHP 4 )

ftp_put -- 上传文件到 FTP 服务器

描述

bool ftp_put ( resource ftp_stream, string remote_file, string local_file, int mode [, int startpos])

ftp_put() 函数用来上传由 local_file 参数指定的文件到 FTP 服务器,上传后的位置由 remote_file 指定。传输模式参数 mode 只能为 FTP_ASCII (文本模式) 或 FTP_BINARY (二进制模式)。

注: 参数 startpos 仅适用于 PHP 4.3.0 以上版本。

如果成功则返回 TRUE,失败则返回 FALSE

例子 1. ftp_put() 实例

$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_ASCII);