-1
我無法從ftp下載文件。 我想下載FTP從Codeigniter。 FTP下載文件
$this->load->library('ftp');
$config['hostname'] = 'xxx.xx.x.x';
$config['port'] = 'xxx';
$config['username'] = 'ftpuser';
$config['password'] = '123456';
$config['debug'] = TRUE;
$this->ftp->connect($config);
$this->ftp->download("/3.js", "http://test.net/public_html/js/3.js");
的根文件夾中的JavaScript文件(3.js),但我有這個錯誤
FTP下載無法下載指定的文件。請檢查您的路徑
然後我會嘗試這個方法
$files = $this->ftp->list_files('');
foreach($files as $file)
{
$this->ftp->download($file, "http://test.net/public_html/js/".basename($file));
}
但也會出錯
請幫幫我!
您需要將文件保存到服務器上的路徑。這意味着你需要使用正確的路徑,而不是URL。例如。 '$ this-> ftp-> download(「/ 3.js」,「/var/www/public_html/js/3.js」);' –