I am using the following script to upload a zip file on a SFTP server. Though I see the file on server, but it always shows that it's 0 Kb
#Code to upload file to a SFTP server abc.com
import chilkat
sftp = chilkat.CkSFtp()
success = sftp.UnlockComponent("Anything trial")
puttyKey = chilkat.CkSshKey()
ppkText = puttyKey.loadText("xyz.ppk")
success = puttyKey.FromPuttyPrivateKey(ppkText)
sshHostname = "abc.com"
sshPort = 22
success = sftp.Connect(sshHostname,sshPort)
sftp.AuthenticatePwPk("username", "password", puttyKey)
success = sftp.InitializeSftp()
filename = "file.zip"
handle = sftp.openFile(filename ,"writeOnly","createTruncate")
success = sftp.UploadFile(handle,"file.zip")
success = sftp.CloseHandle(handle)