The #fsize Server-Side Include (SSI) directive instructs the Web server to insert the size of specified file into a Web page. 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 this task with ASP script, you can use theFileSystemObject object, which is documented by the Windows Script Technologies Web site in the Microsoft Visual Basic® Scripting Edition (VBScript) or Microsoft JScript® sections.
- Specifies the type of the path to FileName. The path type can be one of the following:
Path Type Meaning File The file name is a relative path from the directory containing the document with the #fsize directive. The included file can be in the same directory or in a subdirectory. The included file cannot be in a directory above the page with the#fsize directive, unless you have checked the box for Enable Parent Paths in the property sheet for the Web folder. This is strongly discouraged because it is a security risk. Any Web user could type ../.. as a part of a URL for your site and be shown the contents of parent folders you may not want them to see. Virtual The file name is a full path from a virtual directory of your Web site.
- Specifies the name of the file for which you want the file size. FileName must contain the file name extension, and you must enclose the file name in quotation marks (" ").
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 this directive must be run by itself or by calling it from an ASP page by using 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 Manager installed, you can modify default extension mappings and add new mappings; . Because you cannot map a file name extension to more than one executable, you cannot use thisdirective in ASP files. ASP files are already mapped to Asp.dll and must stay that way.
--- 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" -->
Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.