我尝试使用以下代码将文件放入sftp
服务器。我使用的是ubuntu 16.04。在
import pysftp as sftp
def sftp_file_transfer():
s = sftp.Connection('ip_address', username='username', password='password')
remote_path = '/var/sftp/uploads/'
local_path = '/home/ubicomp/ubicomp/questions_check'
s.put(local_path, remote_path)
s.close()
我改变了现有的道路。但我得到了错误。我找不到问题。在
^{pr2}$
我已经解决了这个问题。远程路径必须改变。它工作得很好。在
我不得不提到远程路径中具有相同扩展名的文件名,并取消了/var/sftp部分
相关问题 更多 >
编程相关推荐