php - CodeIgniter download a file to windows via FTP -


in website have following 2 functions. first 1 takes ftp connection , creates directory in specified path. server.com/host_path/directoryname example. piece of code works fine. have upload function uploads file test.txt folder directoryname , second function supposed download file local windows machine. error message unable download specified file. please check path. no indication path wrong.

$path = 'server.com/' . $result['path']; $this->ftp->mkdir($path); 

when echo remote , local paths remote = server.com/host_path/directoryname/test.txt , local = c:\users\owner\desktop\test.txt . based on fact above function works below function not, believe windows path wrong difference in functions.

$remotepath = 'server.com/' . $result['path']; $localpath = 'c:\\users\\owner\\desktop\\test.txt'; $this->ftp->download($localpath, $remotepath, 'auto');` 

please help!

for remotepath, use absolute path starting "/"


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -