Latest revision as of 11:29, 25 March 2010

This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[Edit Descripton]JFTP is an FTP client class, that allows you to connect and interact with an FTP server.

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}

Importing

Examples

<CodeExamplesForm />

Example

$host='joomla.org';$port=21;$options=null;$user='randomUserName';$pass='thisIsDefinatlyNotThePassword';
jimport('joomla.client.ftp');/*
* The JFTP::getInstance() method will connect us to the FTP server and automatically
* log us in. We could do the same with the connect() and login() methods. Also check
* out JClientHelper::getCredentials('ftp');
*/$ftp= JFTP::getInstance($host,$port,$options,$user,$pass);if($ftp->isConnected()){//We are connected.//Let's print the details of the root directoryecho'<pre>';print_r($ftp->listDetails());echo'</pre>';/* Assuming we only have one "Joomla" directory, this would look like this.
Array
(
[0] => Array
(
[type] => 1
[rights] => drwxr-xr-x
[user] => randomUserName
[group] => ftpusers
[size] => 4096
[date] => 03-15
[time] => 2008
[name] => Joomla
)
)
*///Let's create a directory$ftp->mkdir('test');//Let's create a file in that new directory$ftp->create('test/fairyTale.txt');//Let's write the first line of our Fairy Tale into our newly created text file$ftp->write('test/fairyTale.txt','Once upon a time, there was a litte Mermaid, called Arielle');//Let's read the fairy tale out of the file, and echo it out.$fairyTale='';$ftp->read('test/fairyTale.txt',$fairyTale);echo$fairyTale;//Let's think of a name for our fairyTale, and rename the file$ftp->rename('test/fairyTale.txt','test/Arielle.txt');//I think you got the idea =)}