I'm using Laravel 5.7 and have remote server for uploading files. I'm trying to upload files from application server to remote server using league/flysystem-sftp
. Everything works fine for static files but now i want to upload ZIP
and unzip
on remote server.
For uploading zip I'm using SFTP disk
configuration in filesystems.php
:
'sftp' => [
'driver' => 'sftp',
'host' => 'example.com',
'username' => 'your-username',
'password' => 'your-password',
'root' => 'my/root/path/'
],
Storage::disk('sftp')->putFileAs('zip-files', new File('/path/to/zip'), 'example.zip');
How can i extract now this uploaded ZIP file on remote server without writing SSH commands
and try with same packages ?
I'm using ZipArchive
too in this project and is there any way to unzip files on remote server using ZipArchive
?