Copy link to clipboard
Copied
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 . .
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
doesn't make a difference. Same error. I can getfile and putfile just fine.
Copy link to clipboard
Copied
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.
^_^
Copy link to clipboard
Copied
permissions are good, running the command in CF8 to this exact folder
Copy link to clipboard
Copied
I would also throw the following in, as a long shot. FTP error 215 says something about system name. So, what about changing your name attribute from test to, say, myTest ?
Copy link to clipboard
Copied
I had that thought as well. I tried different names with the same result, i think the error is a false positive
Copy link to clipboard
Copied
The "NAME" that the error 215 is referring to is the server name at the other end. The "Name" in CFFTP is your query name.
At this point I would run FileZilla with full tracing/logging turned on, and see if anything funky happens when you connect to the ftp server. It will do a listdir automatically when it connects. Look to see if the server changes its name or something like that. The ftp support in CF10 is almost certainly different from that in CF8 or CF9, so maybe there is something that it is sensitive to.
Wishing this advice wasn't so vague, but at this point it looks like you need more information about the connection that what CF is going to give you. Keep us posted.
reed
Copy link to clipboard
Copied
Any word on this? I'm having the same problem. I can connect to a filezilla server and see that both coldfusion and ftp from a command prompt will translate the listdir and dir commands as a LIST action in filezilla. I don't have access to the ftp server that's giving me this 215 error code unfortunately, maybe something interesting would be found in those logs.
Copy link to clipboard
Copied
I had to do a workaround, using cfexecute to call a local windows batch file to just get * and put them in a folder and have cfdirectory review.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Will do. However we installed CF 9 and it worked on first try. We had
been trying for a week with CF10
Copy link to clipboard
Copied
See this bug report I created Bug#3796626 - CFFTP LISTDIR Command Fails