API16:JFTP/delete
From Joomla! Documentation
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.
Contents |
Description
Method to delete a path [file/folder] on the FTP server
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
delete($path)
| Parameter Name | Default Value | Description |
|---|---|---|
| $path | $path Path to delete |
Returns
boolean True if successful
Defined in
libraries/joomla/client/ftp.php
Importing
jimport( 'joomla.client.ftp' );
Source Body
function delete($path) { // If native FTP support is enabled lets use it... if (FTP_NATIVE) { if (@ftp_delete($this->_conn, $path) === false) { if (@ftp_rmdir($this->_conn, $path) === false) { JError::raiseWarning('35', 'JFTP::delete: Bad response'); return false; } } return true; } // Send delete file command and if that doesn't work, try to remove a directory if (!$this->_putCmd('DELE '.$path, 250)) { if (!$this->_putCmd('RMD '.$path, 250)) { JError::raiseWarning('35', 'JFTP::delete: Bad response', 'Server response: '.$this->_response.' [Expected: 250] Path sent: '.$path); return false; } } return true; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
