1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
$size_ftp = sprintf("%u",ftp_size($ftp, $directory_include.'/'.$file)); //je récupère la taille du fichier
$ret = ftp_nb_get($ftp,$local, $directory_include.'/'.$file, FTP_BINARY);
$size_local = filesize($local);
while ($ret == FTP_MOREDATA && $stop == 0){
clearstatcache();
$size_local =filesize('$local');
$size_percent = ($size_local / $size_ftp) * 100;
echo "\n"."<script language=\"Javascript\">getPercent(".$size_percent.",'progBar');</script>";
ob_flush();
flush();
$ret = ftp_nb_continue($ftp);
}
if ($ret != FTP_FINISHED) {
echo "There was an error downloading the file...";
} |
Partager