1

I have written below python code to download all the files from SFTP.Daily we have to pull those file and write into windows server locally Below code shows connection is successful, however through a permission error Any help on this please

error: Exception has occurred: PermissionError [Errno 13] Permission denied:'Z://ep//sftp//'

import pysftp
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None
myHostname = 'XX.XX.XXX'
myUsername = 'sftpo'
myPassword = 'XXX'
with pysftp.Connection(host=myHostname, username=myUsername, password=myPassword,cnopts=cnopts) as sftp:
    print ("connection sucess")
    remotefilepath = '/Home/Live/*.*'
    localfilepath = 'Z://ep//sftp//'
    sftp.get(remotefilepath, localfilepath)
MSM
  • 327
  • 2
  • 6
  • 12

0 Answers0