Use the CFDIRECTORY tag to return file information from a specified directory and to create, delete, and rename directories.
As with CFFILE, ColdFusion administrators can disable CFDIRECTORY processing in the ColdFusion Administrator Tags page. See the CFML Language Reference for details on the syntax of this tag.
When using the ACTION=LIST, CFDIRECTORY returns five result columns you can reference in your CFOUTPUT:
![]() |
To view directory information: |
<HTML> <HEAD> <TITLE>List Directory Information</TITLE> </HEAD> <BODY> <H2>List Directory Information</H2> <CFDIRECTORY DIRECTORY="c:\inetpub\wwwroot\mine" NAME="mydirectory" SORT="size ASC, name DESC, datelastmodified"> <TABLE> <TR> <TH>Name</TH> <TH>Size</TH> <TH>Type</TH> <TH>Modified</TH> <TH>Attributes</TH> <TH>Mode</TH> </TR> <CFOUTPUT QUERY="mydirectory"> <TR> <TD>#mydirectory.name#</TD> <TD>#mydirectory.size#</TD> <TD>#mydirectory.type#</TD> <TD>#mydirectory.datelastmodified#</TD> <TD>#mydirectory.attributes#</TD> <TD>#mydirectory.mode#</TD> </TR> </CFOUTPUT> </TABLE> </BODY> </HTML>
directoryinfo.cfm
and view it in your browser.