I need to download a zip file from my implict ftps server. Here is the code which I tried to download the file:
import sys
import chilkat
ftp = chilkat.CkFtp2()
# Any string unlocks the component for the 1st 30-days.
success = ftp.UnlockComponent("Anything for 30-day trial")
if (success != True):
print(ftp.lastErrorText())
sys.exit()
# If this example does not work, try using passive mode
# by setting this to True.
ftp.put_Passive(False)
ftp.put_Hostname("hostip")
ftp.put_Username("username")
ftp.put_Password("password")
ftp.put_Port(990)
# We don't want AUTH SSL:
ftp.put_AuthTls(False)
# We want Implicit SSL:
ftp.put_Ssl(True)
# Connect and login to the FTP server.
success = ftp.Connect()
if (success != True):
print(ftp.lastErrorText())
sys.exit()
else:
# LastErrorText contains information even when
# successful. This allows you to visually verify
# that the secure connection actually occurred.
print(ftp.lastErrorText())
print("FTPS Channel Established!")
#clearing the control channel
success = ftp.ClearControlChannel()
if (success != True):
print(ftp.lastErrorText())
sys.exit()
else:
print(ftp.lastErrorText())
ftpResponse = ftp.feat()
fileSize = ftp.GetSizeByName("15_20.zip")
if (fileSize < 0):
print("file does not exist")
else:
print("file exists and is " + str(fileSize) + " bytes in size")
ftp.put_RestartNext(True)
localFilename = "C://mcx5min//14_40.zip" # copy the path from the old mcx.py
remoteFilename = "14_40.zip"
success = ftp.GetFile(remoteFilename, localFilename)
if (success != True):
print(ftp.lastErrorText())
sys.exit()
ftp.Disconnect()
In this program I'm able to login to my ftps server and also able to find the existence of file in it. But when I try to download the file through GetFile()
function its throwing an error like "426 data connection closed, SSL/TLS negotiation failed
". I don't know exactly what was the error am locally using windows server.I am really very new to this. So please anybody help me out to solve this issue.