Skip to main content
Participant
May 16, 2013
Question

CF10 CFFTP listDir

  • May 16, 2013
  • 2 replies
  • 3806 views

Can someone please help. I'm trying to do a simple list of directory and the command doesn't work.         

  <cfftp
     action="listdir"

     server="<a href="ftp://ftp.boongroup.com">~~~~~.com</a>"
     username="~~"<br>     password="~~~"
     name="test"
     directory="out"
     >

<cfdump var="#test#">  the command works fine in CF8 and CF9. But in CF10 it returns

h1. An error occurred during the FTP listdir operation.


Error: 215 . .

    This topic has been closed for replies.

    2 replies

    Participating Frequently
    December 31, 2013

    Adobe - you seem to have a problem here. I have tried ListDir on known connections and it fails every time. Can somebody provide an answer?

    Participating Frequently
    December 31, 2013

    Action="close" does not work either. It says "invalid Connection Specified" even if this command is issued immediately after the Open command which works fine.

    vishu_13
    Inspiring
    January 8, 2014

    If you can access your ftp server via any ftp client like Filezilla then you will be able to list directories via ColdFusion as well. Share the stack trace as well.

    Sample Code

    <cfftp 

         port="21"

        action = "open"

        username = "username"

        connection = "ftp"

        password = "password"

        server = "abc.xyz.com"

        stopOnError = "Yes">

    <!--- Confirmation of Open --->   

       

    <cfoutput> Connection Open :#cfftp.succeeded# </cfoutput>

       

       

    <p>List the files in a directory:

    <cfftp

    action = "LISTDIR"

        stopOnError = "Yes"

        name = "ListFiles"

        directory = "/"

        connection = "ftp">

        <cfdump var="#ListFiles#">

       

    <cfftp

    action="close"

    connection="ftp"

    stopOnError = "Yes">

           

            <!--- Confirmation of Close --->   

           

    <cfoutput> Connection Closed :#cfftp.succeeded# </cfoutput>

    HTH

    Thanks

    VJ

    BKBK
    Community Expert
    Community Expert
    May 17, 2013

    You first have to open the connection. After the listDir action, you have to close the connection. Follow the fully worked-out example in the ColdFusion livedocs on CFFTP with listDir action.

    cf_stv_Author
    Participant
    May 17, 2013

    doesn't make a difference. Same error. I can getfile and putfile just fine.

    WolfShade
    Legend
    May 17, 2013

    Does the folder that you're trying to list give READ permission to the FTP account that's trying to read it?

    Just throwin' stuff out there.

    ^_^