且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用paramiko python从sftp文件解码Zip文件

更新时间:2022-11-07 14:42:38

您无法使用 SFTP 协议在远程服务器上解压缩文件.这是不可能的.

You cannot unzip files on remote server using SFTP protocol. That's not possible.

您也不能使用客户端库来解压缩非本地文件.您必须下载存档(到临时本地文件或至少到内存),提取它并上传提取的文件.什么可以很慢.

You cannot use client-side libraries to unzip a non-local file either. You would have to download the archive (to a temporary local file or at least to a memory), extract it and upload the extracted files. What can be very slow.

你能做的***的事情(如果你有 shell 访问权限)是在远程服务器上执行(使用 SSH)任何可用的命令来进行提取.

Best you can do (if you have a shell access) is to execute (using SSH) any available command on the remote server to do the extraction.