ftp_fget

(PHP 3 >= 3.0.13, PHP 4, PHP 5)

ftp_fget -- 从 FTP 服务器上下载一个文件并保存到本地一个已经打开的文件中

说明

bool ftp_fget ( resource ftp_stream, resource handle, string remote_file, int mode [, int resumepos] )

ftp_fget() 函数用来下载由 remote_file 指定的文件,并写入到本地已经被打开的一个文件中。参数 handle 为本地已经打开的文件的句柄。传送模式参数 mode 必须是 (文本模式) FTP_ASCII 或 (二进制模式) FTP_BINARY 中的一个。

注: 参数 resumepos 仅适用于 PHP 4.3.0 以上版本.

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

参见 ftp_get()ftp_nb_get()ftp_nb_fget()


add a note add a note User Contributed Notes
rodrigo-rocha at oi dot net dot br
06-Sep-2002 10:56
If you suply only a filename to the second parameter of function the ftp_get will open a pointer to the local file creating it and write to it.It's ok if your server dont execute for to mutch time and you dont get too many files but if you do it too many times the pointers created by ftp_get will not be closed and will end your opened files capacity at your server making it to do not open any more files until you restart it.