[ListFiles path=FolderPath]File Tags[/ListFiles]
Lists all the files in the specified folder.

To display a list of all the files in a particular folder, put a [ListFiles] context into a WebDNA template. You may specify an absolute or relative path to the folder just as you would specify an absolute or relative URL, and the folder name itself may be a WebDNA [xxx] tag.

Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):

[ListFiles path=../WebCatalog/]
File Name: [FileName]<br>
Modified: [ModDate]<br>
Size: [Size]<br>

Parameters for [ListFiles]:

Parameter Description
(Required) The path to the folder which is to be listed. This path is relative to the template
(Optional) Macintosh only: if set to T, then display invisible filenames, if set to F, do not display invisible filenames
New for5.0
(Optional) filters files by name
New for 5.0
(Optional) if set to T, then display filenames that match ‘Name’ criteria, if set to F, exact match of filenames that match ‘Name’ criteria not required

The following tags are available inside a [ListFiles] context:
Tag Description
"T" if this item is actually a folder. "F" otherwise.
"T" if this item is actually a file. "F" otherwise.
Name of the file.
Full path to the file, starting from its containing FolderPath.
Last date the file was modified.
Last time the file was modified.
Date the file was created.
Time the file was created.
The file's size, in bytes.
A number from 1 to the total number of files indicating this file's index position in the list
The folder path leading to the file.

You can use the 'Name' and 'Exact' parameters with the [listfiles] context to 'filter' the results.

For example:

If the current folder contains the files:

[listfiles path=../&name=file1&exact=f]


Results will be: