FTP Extension: Download, Reverse Mirror |
[eluser]caleblloyd[/eluser]
Hello, I have created a simple extension for the FTP library that includes the option to download a file from remote to local or mirror a directory from remote to local. It is my personal recommendation that this be included in CI's next release. Code: <?php (defined('BASEPATH')) OR exit('No direct script access allowed'); And add this line to your language file: Code: $lang['ftp_unable_to_download'] = "Unable to download the specified file. Please check your path.";
[eluser]Phil Sturgeon[/eluser]
I wrote this method up about 3 years ago, and finally it has been accepted into the core for 2.0. You really should google before you write code like this. :-)
[eluser]caleblloyd[/eluser]
Phil- I did study your code before creating this extension. Your code that I looked over is hosted here: http://styledna.pastebin.com/f77873a3 The fundamental problem was your code did not make provisions for mirroring a remote directory into the local directory, it merely provided downloading of one file at a time. This extension does not make use of multiple configurations like your extension, however, it does have function that deals with the mirroring of a remote folder into a local one. I hope that CI 2.0 will include the mirroring functionality provided by this extension as well as the download functionality provided by both this extension and your original extension. One thing to think about including in the FTP download function is a retry mechanism that allows a config parameter for number of retries on downloading a file before the function outright fails and throws an error message. Also, an option for silent fail would be nice... I would be glad to develop these and send them into CI. I just am not sure how to do that. -Caleb |
Welcome Guest, Not a member yet? Register Sign In |