I did this just recently for a client. We implemented a fairly simple 
solution using Jscape Secure FTP Factory for Java. It works well, however I 
was not able to get listeners to work, so reporting on successfully 
transfers is not great. I do a directory listing after the upload and look 
for the file I just uploaded. This works in my case, because the file name 
is always unique. Might not work for you. Maybe you can find a better way. 
The url is http://www.jscape.com/sftp/index.html it costs $499.00.

This is the code we used to implement it:

<cfset jarpath = 'C:\CFusionMX7\wwwroot\WEB-INF\lib\sftp.jar'>


<cfscript>

system = CreateObject("java", "java.lang.System");
classpath = system.getProperty("java.class.path");
if (FindNoCase("sftp", classpath) LTE 0)
{
  classpath = classpath & ";#jarpath#";
  system.setProperty("java.class.path",classpath);
}


util = CreateObject("java", "com.jscape.inet.ssh.util.SshParameters");
sLogin  = 
util.init('#dailyftp_profiles.ftpaddress#','#dailyftp_profiles.username#','#dailyftp_profiles.password#');
sftpObject = CreateObject("java", "com.jscape.inet.sftp.Sftp");
sftp = sftpObject.init(sLogin);

// connect and set timeout
sftp.connect();
sftp.setTimeout(1000);

// set remote directory if requested
if (#dailyftp_profiles.homedirectory# neq  ''){
         sftp.setDir("#dailyftp_profiles.homedirectory#");
}

sftp.setAuto(true);
// upload the file
sftp.upload("#request.general_tempfile_root##tempfilename#");
sftp.renameFile("#tempfilename#","#remoteFileName#");
//get listing
dirListing2 = sftp.getDirListingAsString();
// disconnect from SSH server
sftp.disconnect();
</cfscript>

<!--- check that the file was uploaded --->
<cfif not dirListing2 contains '#remoteFileName#'>
         <!--- do error handling here for failed upload --->
</cfif>


At 03:02 PM 3/2/2006, you wrote:
>Damien McKenna wrote:
> > At work we're in the drawing stages of an automated file transfer
> > program and was wondering if anyone had any experiences of doing secure
> > file transfers using CFFTP or something else?  I'm thinking of either
> > SSH, SSL or TLS-based transfers.  Any thoughts, folks?  Thanks.
>
>I would look into mounting the remote directory as a local
>filesystem using WebDAV or NFS over SSL. What is the usage pattern?
>
>Jochem
>
>
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234022
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to