I am trying to upload all the files in my Windows folder to SFTP folder. Below is my code. If there are no files in csv folder, nothing should happen. How to achieve this?
with pysftp.Connection(host, username, password) as sftp:
localpath = r'files\csv'
remotepath = '/2021/November'
sftp.put(localpath,remotepath)
It throws the below error for now.
PermissionError: [Errno 13] Permission denied: 'files\csv'