Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcel

Python Examples

ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Bounced Email
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
ECC
Email Object
Encryption
FTP
Facebook
Firebase
GeoOp
Google APIs
Google Cloud Storage
Google Drive
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc

IMAP
JSON
Java KeyStore (JKS)
Jwt
MHT / HTML Email
MIME
NTLM
OAuth1
OAuth2
OpenSSL
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
Socket/SSL/TLS
Spider
Stream
Tar Archive
Twitter
XML
XMP
Xero
Zip
curl

 

 

 

(Python) Simple FTP Download

Simple example to download a file from an FTP server.

Chilkat Python Downloads

Python Module for Windows, Linux, MAC OS X,
Solaris, FreeBSD, and ARM Embedded Linux

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()

ftp.put_Hostname("ftp.someFtpServer.com")
ftp.put_Username("myLogin")
ftp.put_Password("myPassword")

#  Connect and login to the FTP server.
success = ftp.Connect()
if (success != True):
    print(ftp.lastErrorText())
    sys.exit()

#  Change to the remote directory where the file is located.
#  This step is only necessary if the file is not in the root directory
#  for the FTP account.
success = ftp.ChangeRemoteDir("junk")
if (success != True):
    print(ftp.lastErrorText())
    sys.exit()

localFilename = "c:/temp/hamlet.xml"
remoteFilename = "hamlet.xml"

#  Download a file.
success = ftp.GetFile(remoteFilename,localFilename)
if (success != True):
    print(ftp.lastErrorText())
    sys.exit()

success = ftp.Disconnect()

print("File Downloaded!")

 

© 2000-2016 Chilkat Software, Inc. All Rights Reserved.