0
votes

This is what I have done so far.

Configured Filezilla FTP server on localhost. And added user: Admin with shared folder C://ftp there is a file inside that folder 123.jpg

So when I try to Download it using ftp class in Codeigniter;

Unable to download the specified file. Please check your path.

this is the code I'm using to download. FTP successfully connects but fails download due to incorrect file path.

$this->ftp->download('/123.jpg', 'D:/');

What should be changed in the above code?

2

2 Answers

0
votes

Well, D:/ definitely dose not seems to be a path that is wrong. As for the doubt goes in the file you trying to download.

You can debug with the same - connect the ftp server using a ftp client, see the files / folders in list. There you can confirm as whether or not the file exists directly in path or not.

0
votes

Solved it !

Seemed that local file path need to have the 'file name' at the end as well.

$this->ftp->download('/123.jpg', 'D:/blah.jpg');

And file would be downloaded to D: renamed as blah.jpg