标签:参考资料 path guid lib amp style host pat nbsp
了解php的ftp使用
使用CI封装好的ftp类库
上传 $this->load->library(‘ftp‘); $config[‘hostname‘] = ‘ftp.example.com‘; $config[‘username‘] = ‘your-username‘; $config[‘password‘] = ‘your-password‘; $config[‘debug‘] = TRUE; $this->ftp->connect($config); //路径要绝对路径 $this->ftp->upload(‘/local/path/to/myfile.html‘, ‘/public_html/myfile.html‘, ‘ascii‘, 0775); $this->ftp->close();
下载文件列表 $this->load->library(‘ftp‘); $config[‘hostname‘] = ‘ftp.example.com‘; $config[‘username‘] = ‘your-username‘; $config[‘password‘] = ‘your-password‘; $config[‘debug‘] = TRUE; $this->ftp->connect($config); $list = $this->ftp->list_files(‘/public_html/‘); print_r($list); $this->ftp->close();
参考资料:
http://codeigniter.org.cn/user_guide/libraries/ftp.html
http://php.net/manual/zh/book.ftp.php
标签:参考资料 path guid lib amp style host pat nbsp
原文地址:http://www.cnblogs.com/norm/p/6262473.html