JFTP/chdir: Difference between revisions
From Joomla! Documentation
m removing red link to edit, no existant pages |
m clean up |
||
| Line 2: | Line 2: | ||
Method to change the current working directory on the FTP server | Method to change the current working directory on the FTP server | ||
<! removed transcluded page call, red link never existed > | <! removed transcluded page call, red link never existed > | ||
| Line 53: | Line 51: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | <! removed transcluded page call, red link never existed > | ||
Revision as of 13:57, 24 March 2017
Description
Method to change the current working directory on the FTP server
<! removed transcluded page call, red link never existed >
Syntax
chdir($path)
| Parameter Name | Default Value | Description |
|---|---|---|
| $path | $path Path to change into on the server |
Returns
boolean True if successful
Defined in
libraries/joomla/client/ftp.php
Importing
jimport( 'joomla.client.ftp' );
Source Body
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
<CodeExamplesForm />