markowe
10-09-2009, 08:35 AM
Maybe this is a PHP question, but I am interested in this in the context of Bluehost too: how do I go about retrieving a large file, say 200Mb remotely via PHP, using FTP? I've never had to do this before, so am a newbie as far as this area of PHP goes.
Surely all the methods available in PHP (cUrl, fopen etc.) depend on reading the entire file into memory first, and then saving. This would time out my PHP thread long before the file was downloaded and probably cause a CPU/memory problem too, for a file that size, wouldn't it?
Is there a way to fetch a file via some kind of background thread on the server?
Thanks.
P.S. Is a cron job with wget the way forward? It's just I can't face learning yet another scripting language! If it can be done through PHP that would be a lot easier on me!
Surely all the methods available in PHP (cUrl, fopen etc.) depend on reading the entire file into memory first, and then saving. This would time out my PHP thread long before the file was downloaded and probably cause a CPU/memory problem too, for a file that size, wouldn't it?
Is there a way to fetch a file via some kind of background thread on the server?
Thanks.
P.S. Is a cron job with wget the way forward? It's just I can't face learning yet another scripting language! If it can be done through PHP that would be a lot easier on me!