I have one requirement in which i need to get zip file from remote sftp and read its data after extract it.
I see there is class Magento\Framework\Filesystem\Io\Sftp
which i can use like below.
\Magento\Framework\Filesystem\Io\Sftp $ftp
){
$this->ftp = $ftp;
}
public function uploadFile(){
$open = $this->ftp->open(
array(
'host' => 'hostname here',
'username' => 'username',
'password' => 'password'
)
);
}
but how to retrieve files and extract it so i can copy to my server.