| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Client |
JFTP |
setOptions |
setOptions() |
Never | Work in Progress |
This method sets options for the FTP client. Currently the only recognized option is ‘type’ which corresponds to the data transfer type. The class defines three type constants: FTP_AUTOASCII, FTP_BINARY and FTP_ASCII. This method returns true if successful, false otherwise.
boolean setOptions ( $options )
| $options | array | is an associative array of options to set. |
Example
jimport( 'joomla.connector.ftp' ); $ftp = new JFTP( array( 'type' => FTP_BINARY ) ); $ftp->connect( '127.0.0.1' ); $ftp->login( 'testuser', 'testpass' ); if ($ftp->setOptions( array( 'type' => FTP_ASCII ) ) ) { echo "Options set successfully!"; } else { echo "Options could not be set!"; }
might produce:
Result
Options set successfully!