(PHP 4, PHP 5, PHP 7)
ftp_get — �� FTP ������������һ���ļ�
$ftp_stream
, string $local_file
, string $remote_file
, int $mode
[, int $resumepos
= 0
] ) : boolftp_get() ������������ FTP ��������ָ�����ļ�������Ϊ�����ļ���
ftp_stream
FTP ���ӵ����ӱ�ʶ����
local_file
�ļ����ص�·��������ļ��Ѿ����ڣ���ᱻ���ǣ���
remote_file
�ļ���Զ��·����
mode
����ģʽ��ֻ��Ϊ (�ı�ģʽ) FTP_ASCII
��
(������ģʽ) FTP_BINARY
�е�����һ����
resumepos
��Զ���ļ������λ�ü������ء�
�ɹ�ʱ���� TRUE
�� ������ʧ��ʱ���� FALSE
��
Example #1 ftp_get() ����
<?php
// define some variables
$local_file = 'local.zip';
$server_file = 'server.zip';
// 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 download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
echo "Successfully written to $local_file\n";
} else {
echo "There was a problem\n";
}
// close the connection
ftp_close($conn_id);
?>
�汾 | ˵�� |
---|---|
4.3.0 |
������ resumepos ��
|