Search

GlobalSCAPE Knowledge Base

Automatically encrypting and compressing transfers

Secure FTP Server - DEPRECATED

THE INFORMATION IN THIS ARTICLE APPLIES TO:

  • Secure FTP Server, all versions

DISCUSSION

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

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 wished to also 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 Pro 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

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

Details
Last Modified: 12 Years Ago
Last Modified By: GlobalSCAPE 5
Type: INFO
Rated 1 star based on 10 votes.
Article has been viewed 24K times.
Options
Also In This Category