title: Move files from local to remote server using sftp in python
body: <p>I want to copy all files from a local directory to a remote directory. I used the <code>pysftp</code> library for that. My code below is not showing any errors, but my local files are also not being transferred to my remote server.</p>
  
  <p>My code:</p>
  
  <pre><code>import pysftp
  remotepath = '/home/a7user/sftp/sftp/CentralData/'
  localpath = 'E:\\backup\\'
  cnopts = pysftp.CnOpts()
  cnopts.hostkeys = None
  
  with pysftp.Connection(host='xx.xxx.xx.xx',username='user',password='5fTPt00',cnopts=cnopts) as sftp:
  
   sftp.put_d(localpath,remotepath)
   print('Upload finished')
  </code></pre>
  
  <p>What am I doing incorrectly?</p>