Forum Moderators: bakedjake
However, I'm not sure of the best way of doing this. I have made a php script to do the job manually but some of the files are quite large and tend to cause browser timeouts.
I am hosted on a redhat linux box and have access to Cron.
Any suggestions?
[us2.php.net...]
[.....]
<?php
$handle = fopen("http://www.example.com/", "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
?>
You can then have it dump the contents of $contents using fwrite():
[us2.php.net...]
one last option: file_get_contents() along with fwrite():
[us2.php.net...]
Haven't tried it that way, but it should be ok.
Make sure that when you put this stuff in a PHP file for running with cron that you have it not output anything (use @ on the functions, etc.) and do you own error trapping/log writing/progress notification/whatever. Or you could get a ton of annoying emails that collect in the account's default email bin.
To run PHP scripts with cron: php -f filname.php
Have fun!