amazon-s3-php-class icon indicating copy to clipboard operation
amazon-s3-php-class copied to clipboard

Added CURL progress function callback when downloading/uploading.

Open racklin opened this issue 7 years ago • 1 comments

Add a progress function when S3 downloading / uploading

S3::setProgressFunction('progress');

function progress($resource,$download_size, $downloaded, $upload_size, $uploaded)
{
    if($download_size > 0)
         echo $downloaded / $download_size  * 100;
    ob_flush();
    flush();
    sleep(1); // just to see effect
}

racklin avatar Dec 15 '16 01:12 racklin

Again, sorry for the late response @racklin. Could you please make some code-styling tweaks? Thanks!

tpyo avatar Mar 14 '17 23:03 tpyo