Working with files, directories and paths

The tutorials in this section cover working with paths (using Server.MapPath) as well as files and folders.

Using Server.MapPath - Finding physical paths.

How to find the path on the server to the current folder or a specified file. More...

Disabling parent paths - The IIS setting to enable / disable parent paths.

How to modify IIS so that users cannot find parent paths with Server.MapPath. More...

Displaying a directory listing - Using the File System Object to list files.

How to use the File System Object to list all the files in a specified folder. Also shown is a technique to extract the extension from the file name. More...

Check if a file exists

How to use the File System Object to check if a file exists. More...

Display file properties - Using the File System Object to display file properties.

How to use the File System Object to list properties of a file stored on the server, including size, date created and date modified. More...

Delete, move and copy files

How to use the File System Object to delete, move and copy files on the server. More...

Delete temporary files from a folder - Using the File System Object and DateDiff

This example lists the files in a directory and deletes any above a certain age. It is a useful method for cleaning up temporary files. More...