Nov-25-2022, 06:59 AM
I am using sftp.put() to upload files into SFTP server.But i am following error
Error:No such file or directoryThis is my present folder structure:
- Django_Project
-djangoapp
-scripts
-sftpconnection.py
-Django_Project
-xmloutput
-output.xmlIn the sftpconnection.py i have the following code to upload the file to sftp serverdef upload_to_sftp(request):
cnOpts = pysftp.CnOpts()
cnOpts.hostkeys = None
sftp = pysftp.Connection(host="10.23.43.56", username="xxxxx", password="xxxx", port=22,cnopts=cnOpts)
sftp.put(localpath='../../xmloutput/Output.xml', remotepath=sftp.cwd("/srv/sftp/inbox"))
sftp.close()any inputs ?
