diff --git a/phpseclib/Net/SCP.php b/phpseclib/Net/SCP.php index 64756c49..8587de77 100644 --- a/phpseclib/Net/SCP.php +++ b/phpseclib/Net/SCP.php @@ -201,7 +201,7 @@ class Net_SCP { return false; } $size = filesize($data); - for ($i = 0; $i < $length; $i++) { + for ($i = 0; $i < $size; $i += $this->packet_size) { $this->_send(fgets($fp, $this->packet_size)); } fclose($fp); @@ -338,4 +338,4 @@ class Net_SCP { $this->ssh->disconnect(); } } -} \ No newline at end of file +}