| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Client |
JFTP |
read |
read() |
Never | Work in Progress |
This method reads a file from the FTP server’s contents into the specified buffer. This method returns true if successful, false otherwise.
boolean read ( $remote, &$buffer )
| $remote | string | is a string containing the path to remote file to read on the FTP server. |
| $buffer | string | is a buffer variable to read the contents of the file into. |
Example
jimport( 'joomla.connector.ftp' ); $ftp = new JFTP( array( 'type' => FTP_BINARY ) ); $ftp->connect( '127.0.0.1' ); $ftp->login( 'testuser', 'testpass' ); $buffer = ''; $ftp->read( 'test/robots.txt', $buffer ); echo $buffer;
might produce:
Results
User-agent: * Disallow: /administrator/ Disallow: /cache/ Disallow: /components/ Disallow: /editor/ Disallow: /help/ Disallow: /images/ Disallow: /includes/ Disallow: /language/ Disallow: /mambots/ Disallow: /media/ Disallow: /modules/ Disallow: /templates/ Disallow: /installation/