I know there are so many solutions about this error, but nothing helped.
I searched in google and found few solutions:
and few more, but nothing helped.
I'm using joomla FTP uploader class and a i found out, everything seems to be OK.
jimport('joomla.client.ftp');
$host = 'host.myhost.com';
$port = 21;
$options = null;
$user = 'xx';
$pass = 'xxxxxxxxxx';
$dir = 'tmp_users/' . $this -> user -> id;
//echo $dir;
$ftp_ob = new JFTP();
$ftp = $ftp_ob -> getInstance($host, $port, $options, $user, $pass);
if ($ftp -> isConnected()) {
if (!is_dir($dir)) {
$ftp -> mkdir($dir);
$ftp -> create($dir . '/index.html');
$ftp -> write($dir . '/index.html', '<!DOCTYPE html><title></title>');
}
}
My goal is to make user_id named directory and upload some files and document there.
public $ftp_enable = '0';
also, chmod main directory to 777, of course, chmod configuration.php and so on. The main problem is that, at first page reload, directory is being created fine, everything is ok, and when i refresh page, error occurs. I tried to check
if is_dir
but did not work. At least I checked joomla/client/ftp.php and found that line, telling me nothing.
public function mkdir($path)
{
// If native FTP support is enabled let's use it...
if (FTP_NATIVE)
{
if (ftp_mkdir($this->_conn, $path) === false)
{
// HERE IS WHAT MAKES ME NERVOUS BREAKDOWN
JError::raiseWarning('35', JText::_('JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE_NATIVE'));
return false;
}
return true;
}
// Send change directory command and verify success
if (!$this->_putCmd('MKD ' . $path, 257))
{
JError::raiseWarning('35', JText::sprintf('JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE', $this->_response, $path));
return false;
}
return true;
}
I use joomla 2.5