I have xml file with collection image urls and I want upload this url using php.
I try using this function:
public function get_file($source, $destination)
{
$ctx = stream_context_create(array('http' => array('timeout' => 90)));
$content = file_get_contents($source, null, $ctx);
$f = fopen($destination, "wb");
fwrite($f, $content);
}
I try download about 7000 images, but after about 500 images, it ceases to copy images and hangs on the file.
What’s wrong?
Maybe your max_execution_time elapses? Try using
set_time_limitto check.