du12197 2013-05-31 09:06
浏览 37

Joomla FTP :: mkdir回复不好

I know there are so many solutions about this error, but nothing helped.

I searched in google and found few solutions:

Here

and here

and here too

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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?