Copy link to clipboard
Copied
I am trying to loop over the info in our FTP directory using:
<cfftp action="listdir" username="commmast" password="H57Jvc21" server="ftp2.idaho.gov" directory="commuser" name="DirList">
<cfdump var="#DirList#">
If I do a dump, I see all the files, and other info I want, but if I do a:
<cfloop query="#DirList#">
#name#
</cfloop>
I'm getting:
Why would this be?
Copy link to clipboard
Copied
SteveG144 wrote:
<cfloop query="#DirList#">
...Complex object types cannot be converted to simple values.
Why would this be?
Because you are NOT supposed to put # signs around the query name in the <cfloop...> tag.
I.E. your code should be
<cfloop query="DirList">
In your code, ColdFusion is trying to resolve the variable "DirList" to derive a string to be used as the name of the query to loop over. A record set (a complex data type) can not be made into a string (a simple data type).
Copy link to clipboard
Copied
Wow its been TOO LONG since I worked with CF............
Thanks