0

I've created a folder on my desktop and trying to put the files i've created into a remote server. my result kept getting an OSerror: Failure. please see my code below:

import paramiko
ssh_client=paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname='sftp-integration.com',port=22,username='',password='')
#uploading file from local to remote 
sftp_client=ssh_client.open_sftp()
sftp_client.put(r'C:\David Han\Desktop\Inspectorio_Folder\purchaseorders.csv','upload/po')
print('file sent')
2
  • most likely need to escape all your \ to \\ in the file path. If not that, post your entire error trace. Commented Jan 13, 2021 at 2:34
  • so my code would need to look like this? r'C:\\David Han\\Desktop\\Inspectorio_Folder\\purchaseorders.csv'? Commented Jan 13, 2021 at 5:05

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.