JFTP/chdir
From Joomla! Documentation
< API16:JFTP
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Method to change the current working directory on the FTP server
<! removed transcluded page call, red link never existed >
Syntax[edit]
chdir($path)
Parameter Name | Default Value | Description |
---|---|---|
$path | $path Path to change into on the server |
Returns[edit]
boolean True if successful
Defined in[edit]
libraries/joomla/client/ftp.php
Importing[edit]
jimport( 'joomla.client.ftp' );
Source Body[edit]
function chdir($path) {
// If native FTP support is enabled lets use it...
if (FTP_NATIVE) {
if (@ftp_chdir($this->_conn, $path) === false) {
JError::raiseWarning('35', 'JFTP::chdir: Bad response');
return false;
}
return true;
}
// Send change directory command and verify success
if (!$this->_putCmd('CWD '.$path, 250)) {
JError::raiseWarning('35', 'JFTP::chdir: Bad response', 'Server response: '.$this->_response.' [Expected: 250] Path sent: '.$path);
return false;
}
return true;
}
<! removed transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]