[This is preliminary documentation and subject to change]

## #config

The #config directive specifies the string to be used for SSI error messages, and the format to be used for dates and file sizes returned by #flastmod, #fsize. You must surround a directive with HTML comment delimiters.

By default, this directive can be used only in STM pages; it cannot be used in ASP pages. To perform these tasks with ASP script, you can use the FileSystemObject object which is documented at MSDN under VBScript or JScript.

###### Syntax

<!-- #config Output=String -->

###### Parameters

Output

Specifies the output to be formatted. The output can be one of the following:

Output | Meaning
ERRMSG | Overrides the message returned to the client browser when an error occurs during the processing of an SSI directive. By default, the error message provides debugging information that details exactly what went wrong. To suppress these details, provide a short, simple error message, such as "An SSI error has occurred." The String parameter contains the new error message.
TIMEFMT | Specifies the format in which dates should be returned to the client browser with the #flastmod directive. The String parameter specifies the format. You can extract individual portions of the date, such as the day of the week or the month, by using formatting tokens in String. (The formatting tokens are the same as those you would use for the ANSI C strftime function). The time and date functions below use the language set with the C library locale rather than the operating system locale. The C library locale is usually set to English. %a Abbreviated name for day of the week (for example, Mon). %A Complete name for day of the week (for example, Monday). %b Abbreviated month name (for example, Feb). %B Complete month name (for example, February). %c Date and time representation that is appropriate for the C locale (for example, 05/06/01 12:51:32). %d Day of the month as a decimal number (01–31) %H Hour in 24-hour format (00–23). %I Hour in 12-hour format (01–12). %j Day of the year as a decimal number (001–366). %m Month as a decimal number (01–12). %M Minute as a decimal number (00–59). %p Current C locale's A.M. or P.M. indicator for 12-hour format (for example, PM). %S Second as a decimal number (00–59). %U Week of the year as a decimal number, with Sunday as the first day of the week (00–51). %w Day of the week as a decimal number, with Sunday as the first day (0–6). %W Week of the year as a decimal number, with Monday as the first day of the week (00–51). %x Date representation for the current C locale (for example, 05/06/01). %X Time representation for the current C locale (for example, 12:51:32). %y Year without the century as a decimal number (for example, 01). %Y Year with the century as a decimal number (for example, 2001). %z, %Z Time-zone name or abbreviation; no characters if time zone is unknown. %% Percent sign.
SIZEFMT | Configures the output of the #fsize directive to display the file size in kilobytes or bytes. The String parameter can have one of two values: "ABBREV" displays file size in kilobytes, and "BYTES" displays file size in bytes.

###### Remarks

The file containing this directive must use a file name extension that is mapped to the SSI interpreter; otherwise, the Web server will not process the directive. By default, the file name extensions .stm, .shtm, and .shtml are mapped to the SSI interpreter (ssinc.dll).

An STM page using the #echo directive must be run by itself, or by calling it from an ASP page with Response.Redirect. Calling an STM page from an ASP page with Server.Transfer, Server.Execute, or #include will not work because that would force the STM page to go through asp.dll instead of through ssinc.dll.

If you have the IIS snap-in installed, you can modify default extension mappings and add new mappings; see Setting Application Mappings. Since you cannot map a file extension to more than one executable, you cannot use this directive in ASP files. ASP files are already mapped to the asp.dll and must stay that way.

###### Example

--- SSI.stm ---

    <!-- #config ERRMSG = "An error occurred processing a directive." -->

    SSI.stm was last formatted on
    <!-- #config TIMEFMT = "%A, the %d of %B, %Y, at %H:%M" -->
    <!-- #flastmod FILE = "ssi.stm" -->
    <BR>

    The size of SSI.stm in bytes is
    <!-- #config SIZEFMT = "BYTES" -->
    <!-- #fsize FILE = "ssi.stm" -->
    <BR><BR>

    This line will print out the ERRMSG configured above<BR>
    <!-- #config SIZEFMT = "BYTE" -->

© 1997-2001 Microsoft Corporation. All rights reserved.