In this section of the tutorial you will enhance the form by adding a fail safe mechanism for the list. If a user deletes files from the disk, but not from the database (e.g. due to lack of space, he connects through FTP and removes old files), the entries should not appear in the list. If they do, an attempt to download them will fail, and display an error.
To hide files that no longer exist on disk, but only in the database, you can use a conditional region: the Show If File Exists server behavior accomplishes just the needed job.
To start enhancing the list, follow the next steps:
Open the list page in Dreamweaver.
Click on the dynamic field that retrieves the
file name. This is done so that you position the cursor inside the list's
table. The conditional region will not be applied only on the download
link.

Select the <tr> tag from the Tag Selector
in Dreamweaver.
![]()
Apply the Show If File Exists server behavior from the Server Behaviors tab > + > MX Kollection > Conditional Regions.
Configure the user interface as shown below:
In the File folder text field enter the path to the folder where the files are saved, or use the Browse button to locate it in the local site structure.
In the Recordset drop-down menu select the recordset used by the list (it should be the only one on page).
In the Field
drop-down menu select the recordset field storing the file name.

Click on OK to apply the server behavior. Save the page and upload it to the server. Now if you delete a file from the server, without removing its database entry, it will no longer be displayed in the list.
As you can see in the image below, the cv.doc
entry still exists in the database, but the list does not display it.
Why? Because it has been manually deleted from the server's disk.
