SHARE
Facebook X Pinterest WhatsApp

SSI: File Returns

Written By
thumbnail
Joe Burns
Joe Burns
Jan 4, 2005

Use these to jump around or read it all…


[The Echo Command]

[The Flastmod Command]

[The Fsize Command]


This is the third in a series of Server Side Include (SSI) tutorials. This tutorial will not delve into what SSI actually is or how it works, so you may want to read the original first. There you’ll find a little script to test your server and information on how to use the Include command to include other documents in your current document. Plus, you’ll be much more prepared for this tutorial.


The Echo Command

Really smart HTML Goodies readers will remember this command from the SSI Date and Times tutorial.

In that tutorial we used the echo command in tandem with the “timefmt” argument to return dates and times. Here, I want to show you four more arguments that go along with the echo command.

The first stands apart from the other three so I’ll use it to show you the format:

<!–#echo var=”DATE_GMT” –>

The DATE_GMT value returns Greenwich Mean Time from the server. That basically stands alone. The next three are used to return information about the current document (the document the command is sitting on).

<!–#echo var=”Document_Name” –>

Returns the name of the document.

<!–#echo var=”Document_URI” –>

Returns the path to the document plus its name.

<!–#echo var=”Last_Modified” –>

Returns when the document was last posted to the server.

Just plop the commands onto the page where you want them. That’s easy enough. Moving along…


The Flastmod Command

The flastmod command is created by smooshing together the text “file last modified.”

This may sound much the same as the echo var=”Last_Modified” above. It is, but with one major difference: The echo command only deals with the document it is sitting on, while the flastmod command will allow you to return data from any file. Here’s the format:

<!–#flastmod file=”page.html” –>

The argument is “file” and is pointing at the file to describe. If you want to point to a file sitting somewhere other than the current directory, just put in the full path:

<!–#flastmod file=”/dog/tree/page.html” –>

The only downfall I’ve found is trying to attach to a file on another server. No good. The include should be on the same server.


The Fsize Command

Fsize means file size. The command works the same way as the flastmod, allowing you to attach it to any file on the server following this format:

<!–#fsize file=”page.html” –>

The command returns the size of the file you point it toward. Try it with both HTML and image files.

That’s That

Enjoy the includes. Hope you can find a good use for them.

 


Enjoy!

 


[The Echo Command]

[The Flastmod Command]

[The Fsize Command]

Recommended for you...

Shopify Alternatives
Helpful Tips for Designing a Landing Page that Converts
Five Essential HTML5 Editors
Best Web Hosting Providers
Enrique Corrales
May 31, 2022
HTML Goodies Logo

The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.