I know some people already ask it but my probelm is when downloading remote images files(each file size is smaller than 200KB). But some files won't be completly saved. And some files can not be saved, or some files are saved but not 100%, I will see some gray shadow at image. The worst is everytime is different error ouput.(it's internet problem?)
I try the following methods to save file.
- file_get_contents
- curl/GD
- copy
it all can work but I can't find the perfect method to save whole files.
The followings are error msg.
- failed to open stream: HTTP request failed! HTTP/1.0 408 Request Time-out in at line "copy"
- Maximum execution time of 60 seconds exceeded( I increase time)
my php program.
set_time_limit(60);
$imageArray=array(image array............);
for ($k=0;$k<count($imageArray);$k++){
echo '<img src="'.$imageArray[$k].'"><br/>';
$isok=copy($imageArray[$k] , dirname(__FILE__).'/photo/item_'.($k+1).'.jpg');
if(isok==true){
echo' success!';
}else{
echo ' Fail';
}