diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 308ab77f..22c1521b 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -2248,9 +2248,6 @@ class SFTP extends SSH2 } $packet = null; $read+= $packet_size; - if (is_callable($progressCallback)) { - call_user_func($progressCallback, $read); - } $i++; } @@ -2280,6 +2277,9 @@ class SFTP extends SSH2 } else { fputs($fp, $temp); } + if (is_callable($progressCallback)) { + call_user_func($progressCallback, $offset); + } $temp = null; break; case NET_SFTP_STATUS: