Skip to main content
WolfShade
Legend
October 19, 2012
Answered

Object of type class coldfusion.tagext.io.FileListTable cannot be used as an array

  • October 19, 2012
  • 1 reply
  • 637 views

Hello, everyone.

I'm trying to play around with Raymond Camden's "getAllTheText" function, and I'm having one of those days where no matter what I do, I get an error.  The title is just the most recent.

I'm just trying to open the "test1.cfm" file that was packaged in the .zip file.  I set the directory to the one I'm attempting to read.  At first, that was the only modification that I made; but that gives the error message spelled out in the title of this post.

If I keep it that way, FileListTable cannot be used as an array.  If I try to use any additional parameters in directoryList other than the path, I get the same error message.  If I try to use CFDIRECTORY and change to query, I get error message "complex objects cannot be used as simple expressions."

Here's how the code started:

<cfset gatt = getallthetexts.textextractor()>

<cfset files = directoryList("./folder","false","query","*.pdf")>

<cfloop index="f" array="#files#">

  <cfif NOT FindNoCase(".DS_store",f)>

    <cfdump var="#gatt.read(f)#">

  </cfif>

</cfloop>

If I take out all but the first argument in directoryList, it works fine.. but then I'm getting all the PDFs that are also in .zip files and recursive folders.  That's too much.

Suggestions?

Thank you, and have a great weekend.

^_^

    This topic has been closed for replies.
    Correct answer WolfShade

    Changed it from "query" to "path", and got an array.

    1 reply

    WolfShade
    WolfShadeAuthorCorrect answer
    Legend
    October 22, 2012

    Changed it from "query" to "path", and got an array.