|
|
Directory
Listing Script
This will display
any of the contents in a directory (discluding itself & the
control file).
If no control
file is included, default values will be implemented.
Here is the
control file (named "control.txt") & its format
Sample control.txt
::printextensions,(true|false)
::printSize,(true|false)
[::extensions,jpg[,bar][,htm][,asp][,...]]
::printLink,(true|false)
::printFileType,(true|false)
What they mean.
| printExtension |
Used
for outputing the file name. If true, then output will be "File.txt".
If false, output will be "File". |
| printSize |
Used
for outputing the files size (in KB). If true, you would see
"5KB". |
extensions
or
include |
Used
to limit what extensions will be displayed. If you only want
them to see *jpg files, then put "jpg". Multiple extensions
must be seperated by a comma. There is no limit to how many
extensions you can have. Cannot be used with exclude. |
| exclude |
Used
to exclude certian files from being listed. Cannot be used with
include . |
| printLink |
A
link to the file will be created if set to true. Otherwise,
it will just output the file name. |
| printFileType |
A
column that would describe what the file is based on its extension.
e.g. .doc would return "Word Document" and .txt would
return "Text Document". |
In order for
this to fully work with great ease, it is recomended to put the
following code in a file named either "default.asp" or
"index.asp". The file may be named something else
You need to put two lines of code in those pages to make the directory
listing work properly:
This line should go at the top:
<!--#include Virtual="/scripts/directory.asp"-->
and this line will go where you want the listing to be:
<%=dir%>
|