Navigation

Search

ftp_connection::passive

Description

Attempts to establish a passive connection to the FTP server.

Syntax

bool ftp_connection::passive ()



Return value

Expected type: Boolean
Description: True if successful, false otherwise


Notes

  • See http://www.slacksite.com/other/ftp.html for a detailed explanation on passive mode.
  • Example: $package_ftp->passive();
  • Checks to make sure a connection has actually been made first.
  • Sends the PASV command to the server and waits 5 seconds for a response.
  • Checks for a 227 (Entering passive mode) response code
  • Sets a 'bad_response' error if the response code isn't 227 or the IP/Port info isn't valid
  • Returns false if there's no connection or the response wasn't valid
  • Parses IP/port info and puts it in "pasv" array for later use
  • Returns true if successful
View all versions of this function