WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP ftp_pasv () function


Definition and usage

The ftp_pasv () function sets passive mode to on or off.

In passive mode, the data connection is initiated by the client, not the server. This is useful when the client is behind a firewall.

Syntax

ftp_pasv (ftp_connection, mode)

parameters description
ftp_connection Required. Specifies the FTP connection to use.
mode Required. Prescriptive mode.
  • TRUE = Passive mode is on
  • FALSE = Passive mode is off


Example

<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

ftp_pasv($conn,TRUE);

ftp_close($conn);
?>