7 Replies Latest reply on Aug 30, 2007 7:07 PM by Newsgroup_User

    CFFTP Issues

    Level 7
      I am trying to get a file from an ftp server and bring it down to my hosting
      web site. What am I doing wrong? I keep getting an error.

      <cfftp connection="RealComp" server="ftp.realcomponline.com"
      username="******" password="******" action="Open" stoponerror="Yes"
      port="21">

      <cfftp action="getfile" connection="RealComp" remotefile="/#newFile#"
      localfile="E:\bpoprosonline.com\assets\property\#newFile#" passive="yes">

      All the server, username, and password information is correct and the remote
      file is to the root of the ftp. Anything else look odd?
      --
      Wally Kolcz
      MyNextPet.org
      Founder / Developer
      586.871.4126


        • 1. Re: CFFTP Issues
          Level 7
          what's the error?

          --

          Azadi Saryev
          Sabai-dee.com
          http://www.sabai-dee.com
          • 2. Re: CFFTP Issues
            Level 7
            WebDev wrote:
            > and the remote file is to the root of the ftp.

            the root of ftp does not necessarily equal the web root, you know...

            --

            Azadi Saryev
            Sabai-dee.com
            http://www.sabai-dee.com
            • 3. Re: CFFTP Issues
              Level 7
              First I got a security error which I fixed with passive="yes", but then I
              get an error telling me that the connection was closed.

              When I log into the ftp using a normal client, I go right into the directory
              with the files I need using ftp.realcomponline.com, so I assume I would do
              the same in my set up as remoteFile="/filename", but I dont seem to grab the
              file. I keep getting an empty file with the right name in the right local
              directory so it seems to be the correct localfile.

              Is the localFile one the FTP server and the remotefile where I want to put
              it?


              • 4. Re: CFFTP Issues
                Level 7
                I guess what I need to know is how to I connect to ftp.realcomponline.com
                using my username and password. Create a connection (action=open) called
                something like 'RealComp'.
                Then I need to grab a file from the main directory called 'idxcn0829072.txt'
                and then move it to my web site's directory at
                E:\webs\bpoprosonline.com\assets\property

                <cfftp connection="RealComp" server="ftp.realcomponline.com"
                username="myuser" password="mypass" action="Open" stoponerror="Yes"
                port="21">

                <cfftp action="getfile" connection="RealComp" localfile="idxcn0829072.txt"
                remotefile="E:\bpoprosonline.com\assets\property\idxcn082907.txt"
                passive="yes">

                or

                <cfftp action="getfile" connection="RealComp" remotefile="idxcn0829072.txt"
                localfile="E:\webs\bpoprosonline.com\assets\property\idxcn082907.txt"
                passive="yes">





                • 5. Re: CFFTP Issues
                  Level 7
                  what happened when you tried both code pieces?

                  --

                  Azadi Saryev
                  Sabai-dee.com
                  http://www.sabai-dee.com
                  • 6. Re: CFFTP Issues
                    Level 7
                    Nothing worked. I stopped getting the errors with the remoteFile being set
                    to the FTP server, but I am not getting any files. AND no errors so I have
                    no idea whats happening


                    • 7. Re: CFFTP Issues
                      Level 7
                      try this code to test where the problem is. this code is straight from
                      DW CF help:

                      ===========================================================
                      <p>Open a connection
                      <cfftp connection = "myConnection"
                      username = "enter username here"
                      password = "enter password here"
                      server = "ftp server address here"
                      action = "open"
                      stopOnError = "Yes">

                      <p>Did Open Connection succeed? <cfoutput>#cfftp.succeeded#</cfoutput>

                      <cfftp connection = "myConnection"
                      action = "LISTDIR"
                      stopOnError = "Yes"
                      name = "ListDirs"
                      directory = "/">

                      <p>FTP Directory Listing:<br>
                      <cftable query = "ListDirs" HTMLTable = "Yes" colHeaders = "Yes">
                      <cfcol header = "<b>Name</b>" text = "#name#">
                      <cfcol header = "<b>Path</b>" text = "#path#">
                      <cfcol header = "<b>URL</b>" text = "#url#">
                      <cfcol header = "<b>Length</b>" text = "#length#">
                      <cfcol header = "<b>LastModified</b>"
                      text = "#DateFormat(lastmodified)#">
                      <cfcol header = "<b>IsDirectory</b>" text = "#isdirectory#">
                      </cftable>


                      <p>Close the connection:
                      <cfftp connection = "myConnection"
                      action = "close"
                      stopOnError = "Yes">

                      <p>Did it succeed? <cfoutput>#cfftp.succeeded#</cfoutput>

                      =========================================================

                      look at the output of ftp dir listing and check if you have correct path
                      to remote file...

                      --

                      Azadi Saryev
                      Sabai-dee.com
                      http://www.sabai-dee.com