Search code examples
pythonsftpparamiko

Paramiko Put - Send SFTP succeed but I got an error message


I am sending a file through a SFTP server which is known to be difficult (PORT: 1002_) The file is going through but I still have the error

ssh_Client = pmiko.SSHClient()
ssh_Client.set_missing_host_key_policy(pmiko.AutoAddPolicy())
ssh_Client.load_system_host_keys()
ssh_Client.connect(str_host, username = str_uid, password = str_pwd, port = self.__int_portnumber)

sftp_oppen = ssh_Client.connect.open_sftp()


sftp_oppen.put(os.path.join(str_folder, str_fileName), str_fileName)

The error message is: [Errno 2] The message [/fileName.xlsx] is not extractable!


Solution

  • It is a matter of parameter:

    sftp_oppen.put(localpath, remotepath, confirm=False)