Код: Выделить всё
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=host, port=port, username=username,password=password, look_for_keys=False)
ftp = ssh_client.open_sftp()
# upload to SFTP server
ftp.putfo(BytesIO(file_obj), remotepath=file_name)
IOError( errno.EACCES, text)
Соединение установлено успешно, но putfo() завершается неудачей. Я также пробовал сделать что-то вроде
Код: Выделить всё
path = "C:\\Program Files (x86)\\freeFTPd\\"
# upload to SFTP server
ftp.putfo(BytesIO(file_obj), remotepath=os.path.join(path, file_name))
Код: Выделить всё
ftp.putfo(BytesIO(file_obj), remotepath="C:\\Program Files (x86)\\freeFTPd\\"+file_name))
Что я здесь делаю не так?
Подробнее здесь: https://stackoverflow.com/questions/783 ... ftp-server