mirror of
https://github.com/danog/phpseclib.git
synced 2025-01-22 13:01:59 +01:00
SCP: better binary local file support for put()
This commit is contained in:
parent
bafbf1276e
commit
56f1b6f411
@ -206,16 +206,18 @@ class Net_SCP {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == NET_SCP_STRING) {
|
$sent = 0;
|
||||||
$this->_send($data);
|
while ($sent < $size) {
|
||||||
} else {
|
$temp = $mode & NET_SCP_STRING ? substr($data, $sent, $this->packet_size) : fread($fp, $this->packet_size);
|
||||||
for ($i = 0; $i < $size; $i += $this->packet_size) {
|
$this->_send($temp);
|
||||||
$this->_send(fgets($fp, $this->packet_size));
|
$sent+= strlen($temp);
|
||||||
}
|
|
||||||
fclose($fp);
|
|
||||||
}
|
}
|
||||||
$this->_close();
|
$this->_close();
|
||||||
|
|
||||||
|
if ($mode != NET_SCP_STRING) {
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user