You are confusing the syntax for cfdirectory and cffile. Look up both tags in the documentation. That will tell you the correct attributes to use for each.
its giving me this error:
Invalid list index 6.
In function ListGetAt(list, index [, delimiters]), the value of index, 6, is not a valid as the first argument (this list has 5 elements). Valid indexes are in the range 1 through the number of elements in the list.
The thing to remember about CF list functions is that they totally ignore empty elements by default. So to CF, this list only has 1 element: “,a,”. That causes problems if you try to use ListGetAt(theList, 3), because to CF … the list doesn’t have 3 elements.
Are you using CF8? If so, use an array instead. Just use the listToArray() function with preserveEmptyElements=true. (It’s the one exception to the rule about list functions)