I am trying to PUT a file into a remote directory but the file in the remote directory is always truncated to 64KB.
I have tried using both pysftp and paramiko to do the transfer as shown below
Code snippet using paramiko
import paramiko
ssh_client =paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=hostname,username=username, password=password)
ftp_client=ssh_client.open_sftp()
response = ftp_client.put(output_file, remote_dir + "/" + os.path.basename(output_file), callback=None, confirm=True)
ftp_client.close()
print(response)
I see the following response
Actual size of the file
File size in remote directory
Code snippet using pysftp
with pysftp.Connection(hostname, username=username, password=password, cnopts=cnopts) as sftp:
channel = sftp.sftp_client.get_channel()
channel.out_window_size += os.stat(output_file).st_size
sftp.put(output_file, remote_dir + "/" + os.path.basename(output_file), preserve_mtime=True )
sftp.close()
Actual size of file
File size in remote directory
As seen above in both cases the file size seems to truncate at 64KB.
Is there a way to customize the size of file being “PUT” using either of these modules?