File Info with SSI.
author: jim.cerny@unh.edu
last modified on Tuesday, 03-Aug-1999 16:45:00 EDT
This is an experiment with file info.
To show information about a browser-displayed file
you can use some of the
environment variables such as DOCUMENT_NAME
and LAST_MODIFIED.
But there is no environment variable for file
size and these variables do not apply to arbitrary
files, including non-text files, located anywhere on the Web server.
Instead, for an arbitrary
files you have available the SSI
directives "flastmod" (last modification date)
and "fsize" (file size).
<!--#fsize virtual="URL-path-relative-to-current-doc" -->
<!--#flastmod virtual="URL-path-relative-to-current-doc" -->
The format of the last modification date defaults to
the fully detailed date
as shown in the date on this document (above). See the
date and time format examples for alternatives.
The file size defaults to
a count in "k" or "m" bytes, but can be specified
in whole bytes instead.
The file size directive is:
<!--#config sizefmt="bytes-or-abbrev" -->
where "bytes" reports in whole bytes and "abbrev" reports
in whole "k" or "m" bytes.
For example, on UNHINFO we have a small
library of graphics files
that are not very well documented. We could use SSI
to document the list of
graphics backgrounds files
and we could do that on any Web page on the server, as shown below.
The size and date formats were set
for this example with the directive:
<!--#config sizefmt="bytes" timefmt="%d-%b-%Y %R" -->
The UNHINFO /Graphics/Backs/ Library:
Return to
Courses page.
|