Automatically Encrypting and Compressing Transfers

You can compress and encrypt files after transferring them using GlobalSCAPE Secure FTP Server's Custom Site Commands. The benefits of encrypting files prior or post transfer depends on the circumstances and level of trust for the particular host.

In the example script below, an entire folder (including sub-folders) is compressed, encrypted (using Twofish 128 bit encryption) and then transferred via regular FTP to an FTP server. Since the archived file is encrypted, there is no need to connect using SSL, OTP, or SSH2 unless you also want to protect the login process.

Example

Dim WshShell, MySite, Return

Set WshShell = CreateObject("WScript.Shell") 'Window's Scripting Host shell object

'next line calls the run method of the WSH shell object. It returns true once CuteZIP does its thing.

'The complete command line instructions for CuteZIP are located here.

If Return = WshShell.run ("c:\progra~1\global~1\CuteZIP\cutezip.exe -c -p12345 c:\archive c:\temp", 0, true) Then

  Set MySite = CreateObject("CuteFTPPro.TEConnection")

  MySite.Option ("ThrowError") = True

  MySite.Host = "ftp://user:pass@myftpsite.com" 'one of the ways to connect using the TE

  MySite.Connect

  MySite.Upload "c:\archive.zip" 'upload the new archive, then check to see if it made it up to the server.

  if not CBool(MySite.RemoteExists("\archive.zip")) then

     MsgBox "Failed to Upload, Exiting!"

  Else

     MsgBox "Success!"

  End If

  MySite.Disconnect

  MySite.Close

Else

MsgBox "Compression and Encryption Failed, Exiting!"

End If

 

 icon_cuteftpnote.gif

You can optionally protect the FTP login by connecting with SSL, SSH2 or OTP using CuteFTP Professional's Transfer Engine (GlobalSCAPE's Secure FTP Server 2 supports SSL, OTP, and SSH2 logins). Use the protocol property to set the connection type prior to calling MySite.Host and MySite.Connect.

Windows XP has a built-in compression/decompression tool. Refer to the Microsoft Support article #306351, at http://support.microsoft.com/kb/306531.