Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Tcl Examples

ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
FileAccess
Firebase
GMail REST API
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Sheets
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)

Java KeyStore (JKS)
Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
Upload
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(Tcl) FTP XCRC

Demonstrates how to tell Chilkat FTP2 to automatically verify an upload using XCRC. XCRC is an FTP extension supported by most FTP servers. If your FTP server does not support XCRC, then no XCRC command will be sent to verify the upload.

The XCRC command asks the FTP server to send an CRC checksum (hash) for the contents of a file. The client can then verify that the checksum matches the local file. The FTP2 Put* methods automatically do this when the AutoXcrc property is turned on.

Note: In order for the FTP2 component to know whether XCRC is supported by your FTP server, you must have the AutoFeat property turned on (which is the default setting). The AutoFeat property tells the FTP2 component to automatically request the FTP server features via the FEAT command after connecting.

Note: XCRC is new functionality that is present in the pre-release downloads at http://www.chilkatsoft.com/preRelease.asp, or in official new versions dated after 30-Oct-2007. If you have trouble, please contact support@chilkatsoft.com.

Chilkat Tcl Extension Downloads

Chilkat Tcl Extension Downloads

load ./chilkat.dll

set ftp [new_CkFtp2]

#  Any string unlocks the component for the 1st 30-days.
set success [CkFtp2_UnlockComponent $ftp "Anything for 30-day trial"]
if {[expr $success != 1]} then {
    puts [CkFtp2_lastErrorText $ftp]
    delete_CkFtp2 $ftp
    exit
}

CkFtp2_put_Hostname $ftp "www.example-code.com"
CkFtp2_put_Username $ftp "****"
CkFtp2_put_Password $ftp "****"

#  Turn on the AutoXcrc property:
CkFtp2_put_AutoXcrc $ftp 1

#  Turn on session logging.  We'll want to examine it to
#  see the XCRC command:
CkFtp2_put_KeepSessionLog $ftp 1

#  Connect and login to the FTP server.
set success [CkFtp2_Connect $ftp]
if {[expr $success != 1]} then {
    puts [CkFtp2_lastErrorText $ftp]
    delete_CkFtp2 $ftp
    exit
}

#  Change to the remote directory where the file will be uploaded.
set success [CkFtp2_ChangeRemoteDir $ftp "junk"]
if {[expr $success != 1]} then {
    puts [CkFtp2_lastErrorText $ftp]
    delete_CkFtp2 $ftp
    exit
}

#  Upload a file.
set localFilename "hamlet.xml"
set remoteFilename "hamlet.xml"

set success [CkFtp2_PutFile $ftp $localFilename $remoteFilename]
if {[expr $success != 1]} then {
    puts [CkFtp2_lastErrorText $ftp]
    delete_CkFtp2 $ftp
    exit
}

#  If we examine the session log, we'll see the XCRC command:
puts [CkFtp2_sessionLog $ftp]

set success [CkFtp2_Disconnect $ftp]

puts "File Uploaded!"

#  Here is the session log showing the XCRC command:

#  220 Serv-U FTP Server v6.3 for WinSock ready...
#  .
#  USER example-code.com
#  331 User name okay, need password.
#  .
#  PASS ****
#  230 User logged in, proceed.
#  .
#  TYPE I
#  200 Type set to I.
#  .
#  SYST
#  215 UNIX Type: L8
#  .
#  FEAT
#  211-Extension supported
#   CLNT
#   MDTM
#   MDTM YYYYMMDDHHMMSS[+-TZ];filename
#   SIZE
#   SITE PSWD;EXEC;SET;INDEX;ZONE;CHMOD;MSG
#   REST STREAM
#   XCRC filename;start;end
#   MODE Z
#   MLST Type*;Size*;Create;Modify*;Win32.ea*;
#  211 End
#  .
#  CWD junk
#  250 Directory changed to /junk
#  .
#  PORT 192,168,1,103,5,144
#  200 PORT Command successful.
#  .
#  STOR hamlet.xml
#  150 Opening BINARY mode data connection for hamlet.xml.
#  226 Transfer complete.
#  .
#  XCRC hamlet.xml
#  250 3C1933BF

delete_CkFtp2 $ftp

 

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