PDA

View Full Version : Display Last Modified date of ANY file even .xls files on a webserver



Wasikton
11-16-2010, 10:24 AM
Hello, have a website that contains many excel files (.xls and .zip). I need to display the last modified date of these files. They currently reside on a webserver. I found this script in this forum, BUT, it only seems to work for .htm or really anything else except .xls or .zip files.

<html>
<head>
<title>Last Modified</title>
<script type="text/javascript">
function getLastMod(){
var myFrm = document.getElementById('myIframe');
var lastModif = new Date(myFrm.contentWindow.document.lastModified);
document.getElementById('LastModified').innerHTML = "Last Update: " + lastModif.toLocaleString();
}
</script>

</head>
<body>
<span id="LastModified"></span>

<iframe id="myIframe" onload="getLastMod()" src="DFC_new_page.htm" style="display:none;" width="352" height="137">
</iframe>


</body>
</html>

Also, when I place an .xls file inside the src= field it ends up opening the file.

HELP!!!! I am new to writing scripts and unfortunately only have Frontpage to use for this. Thank you!!!!!

Sciliano
11-16-2010, 02:22 PM
See,
http://jibbering.com/2002/4/httprequest.html

vppoulis
10-02-2015, 11:01 AM
Hello i am trying to use this code with doc file extension and the date and time i see is from html document and not from the source file. Also the word file every time i refresh the html page opens.
I do not have server only html pages and javascript. With txt files is works smoothly.
Have you any idea how to fix it?
Thanx