using php to save remote images files at local sever but not completely successfully
<p>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?)</p>

<p>I try the following methods to save file.</p>

<ol>
<li>file_get_contents </li>
<li>curl/GD</li>
<li>copy</li>
</ol>

<p>it all can work but I can't find the perfect method to save whole files.</p>

<p>The followings are error msg.</p>

<ol>
<li>failed to open stream: HTTP request
failed! HTTP/1.0 408 Request
Time-out in at line "copy"</li>
<li>Maximum
    execution time of 60 seconds
    exceeded( I increase time)</li>
</ol>

<p>my php program.</p>

<pre><code>set_time_limit(60);

$imageArray=array(image array............);

for ($k=0;$k&lt;count($imageArray);$k++){

echo '&lt;img src="'.$imageArray[$k].'"&gt;&lt;br/&gt;';

$isok=copy($imageArray[$k] , dirname(__FILE__).'/photo/item_'.($k+1).'.jpg');

if(isok==true){
   echo' success!';  
}else{
  echo ' Fail';  
}
</code></pre>
