• Welcome to Simple Machines Community Forum. Please login or sign up.



Attempts to establish a passive connection to the FTP server.


bool ftp_connection::passive ()

Return value

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


  • 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