5 replies
by jay eckles
This shows you how to get the last modified date from a file on the server. You could assign the date to a variable and do whatever processing you want. Per your request, in this example I just print a link to the document and the date next to it .
(inspired by an example in Sams Teach Yourself ASP 3.0 in 21 Days...)
<%
Dim objFSO, objFile
Set objFSO = Server.CreateObject( "Scripting.FileSystemObject" )
Set objFile = objFSO.GetFile( Server.MapPath( "batch.out" ) )
Response.Write "batch.out "
Response.Write objFile.DateLastModified
Set objFile = nothing
Set objFSO = nothing
%>
I have not tested this, so I might have a typo in there or something, but you should get the picture.
Good luck.
Jay Eckles
www.jayeckles.com
by aweston2
Jay,
Many thanks. This worked well and is just what I wanted.
Alan
by nikki96
If you have ASP, you have server side includes (SSI) as far as I know. Use this.
This assumes the file is named myFile.html and is in the same directory as the current file.
For specific formatting infofor the date returned (if you don't like the default) and how to specify a file not in the current directory, see
http://www.useforesite.com/tut_ssi.shtml
(remove any spaces from the url)
Nikki
by aweston2
Nikki
The above command did not work so I must conclude that SSI is not enabled on our web servers even though ASP pages run without a problem. I will look into getting SSI enabled, in the mean time I will use the ASP solution offered by Jay.
Thanks
Alan
Alan
by aweston2
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending