API15

JFTP/mkdir

From Joomla! Documentation

< API15:JFTP
Revision as of 17:13, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Method to create a directory on the FTP server <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The "API15" 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 create a directory on the FTP server

[Edit Descripton]

Template:Description:JFTP/mkdir

Syntax[edit]

mkdir($path)
Parameter Name Default Value Description
$path $path Directory to create

Returns[edit]

boolean True if successful

Defined in[edit]

libraries/joomla/client/ftp.php

Importing[edit]

jimport( 'joomla.client.ftp' );

Source Body[edit]

function mkdir($path) {

        // If native FTP support is enabled lets use it...
        if (FTP_NATIVE) {
                if (@ftp_mkdir($this->_conn, $path) === false) {
                        JError::raiseWarning('35', 'JFTP::mkdir: Bad response' );
                        return false;
                }
                return true;
        }

        // Send change directory command and verify success
        if (!$this->_putCmd('MKD '.$path, 257)) {
                JError::raiseWarning('35', 'JFTP::mkdir: Bad response', 'Server response: '.$this->_response.' [Expected: 257] Path sent: '.$path );
                return false;
        }
        return true;
}

[Edit See Also] Template:SeeAlso:JFTP/mkdir

Examples[edit]

<CodeExamplesForm />