2 Replies Latest reply on Jul 22, 2010 2:26 PM by dalrympj

    How can you FTP with SSH using CF 7?

      We're migrating content to new servers that require SSH connection for FTP.

      Currently the CF code uses CFFTP tag to transfer files from the test to production servers; but what will I need to do to have the CF code transfer files over SSH?

      The servers are using CF version 7 and run on IIS.

      Thank you,
        • 1. Re: How can you FTP with SSH using CF 7?
          Neo Rye Level 1
          You don't! Maybe in CF8, but not with cf7.

          I used a custom tag called cfx_SecureFTP and cfx_SecureFTP. Can't find them anymore on Google, but I could email you what I have.

          OR maybe this would work for you:
          " 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'>


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

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

          // connect and set timeout

          // set remote directory if requested
          if (#dailyftp_profiles.homedirectory# neq ''){

          // upload the file
          //get listing
          dirListing2 = sftp.getDirListingAsString();
          // disconnect from SSH server

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

          from link:
          • 2. Re: How can you FTP with SSH using CF 7?

            Neo Rye -


            I was also using a custom tag "cfx_SecureFTP" on ColdFusion MX7 for FTP uploading. I have no idea where it came from because it was set up by my predecessor.


            Now I've upgraded to ColdFusion 9 and that custom tag won't work any more. Any ideas on why that might be?