Does there exist a class in F3 that allow me work with an FTP? I need upload from a web form, and then download from a web page. I need to work with personal documents, and therefore I can't upload it to public folder.
As Far as I know, F3 has no FTP Class to use. The code below is a work around.
Download this Library: Nicolab/php-ftp-client
Copy the three files in /src/FtpClient/
into a folder named ftpclient
and then add the folder to your autoload
.
Connect!
$ftp = new \FtpClient\FtpClient();
$ftp->connect($host);
$ftp->login($login, $password);
Store the connection in your HIVE
$f3->set('FTP', $ftp);
//Now you can do : https://github.com/Nicolab/php-ftp-client#usage
//Also extend https://github.com/Nicolab/php-ftp-client#extend