PHP Classes

Php image Download issue in sever?

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Php image Download issue in sever?  
Subject:Php image Download issue in sever?
Summary:Problem in downloading images from another server
Messages:1
Author:prabhu
Date:2012-11-06 07:29:42
Update:2012-11-06 08:53:54
 

  1. Php image Download issue in sever?   Reply   Report abuse  
Picture of prabhu prabhu - 2012-11-06 08:53:54
Actually I downloaded the images from another server to my client server. It does not download all images for example if 1000 images available in another server it donwloads only 200 0r some other limits.Also i didn't find any error messages

Can anyone guide what is actual problem?. I wasted a huge time to fix this issue. I attach the code for your reference

<?php
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
ftp_set_option($conn_id, FTP_TIMEOUT_SEC,12000);
@ftp_login($conn_id, $ftp_user, $ftp_pass);


$server="/httpdocs/images/Photo";
$designation = "/home/global/public_html/images/photo";
$content = ftp_nlist($conn_id,$server);
for($i=0;$i<=count($content);$i++){
$exp = explode("\\",$content[$i]);
$images_list[$i] = $exp[1];
}

$images_count = count($images_list);
$image_loop = $images_count/100;
$img_loop_count = round($image_loop);
$i=0;
$img_per_loop_start = 0;
$img_per_loop_end = 100;
while($i<=$img_loop_count)
{
for($j=$img_per_loop_start;$j<$img_per_loop_end;$j++)
{
$source="/httpdocs/images/Photo/".$images_list[$j];
$dest = "/home/global/public_html/images/photo/".$images_list[$j];
ftp_get($conn_id,$dest,$source,FTP_BINARY);

}

$i++;
$img_per_loop_start = $img_per_loop_start+100;
$img_per_loop_end = $img_per_loop_end+100;
}

ftp_close($conn_id);
?>