Current Location: Home> Function Categories> ftp_pasv

ftp_pasv

Returns whether the current FTP passive mode is on.
Name:ftp_pasv
Category:Uncategorized
Programming Language:php
One-line Description:Returns whether the current FTP passive mode is on.

Definition and usage

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

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

实例

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

ftp_pasv($conn,TRUE);

ftp_close($conn);
?>

grammar

 ftp_pasv ( ftp_connection , mode )
parameter describe
ftp_connection Required. Specifies the FTP connection to be used (the identifier of the FTP connection).
mode

Required. Prescribed mode.

  • TRUE = passive mode on
  • FALSE = passive mode off

illustrate

If the parameter mode is true, passive mode transmission (PASV MODE) is turned on, otherwise, if the parameter mode is false, passive mode is turned off. In the case of passive mode on, the data transfer is initiated by the client, not by the server.

Return true if successful, and false if failed.

Similar Functions
Popular Articles