PHP ftp_pasv () function
Definition and Usage
ftp_pasv () function to set the passive mode on or off.
In passive mode, data connections are initiated by a client to, rather than the server. This is useful when the client is behind a firewall.
grammar
ftp_pasv(ftp_connection,mode)
参数 | 描述 |
---|---|
ftp_connection | 必需。规定要使用的 FTP 连接。 |
mode | 必需。规定模式。
|
Examples
<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
ftp_pasv($conn,TRUE);
ftp_close($conn);
?>
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
ftp_pasv($conn,TRUE);
ftp_close($conn);
?>
Complete PHP FTP Reference