File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Trying To Get File Date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Trying To Get File Date" Watch "Trying To Get File Date" New topic

Trying To Get File Date

Pat Flickner
Ranch Hand

Joined: Nov 17, 2003
Posts: 173
I'm reading in a bunch of file descriptions with the pathname set up dynamically for the anchor tag. I want to create a column showing "Last Updated" for the files that are read in. How do I do that? All I can find is stuff related to reading in the lastmodified of the document, meaning the HTML document that is being processed at the time. I want to read the file lastmodified date from the file in the pathname in the anchor tag. Ex:

<a href="reports/reference/file.doc">Reference File</a>   Last Updated on May 22, 2006. file file

I have the full path, but I only load the relative path to the file. All I've been able to find is this:

Any help will be appreciated. Thanks.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You would have to use server side code since last modified only going to work with the current page and only if the server is set up correclty.

Pat Flickner
Ranch Hand

Joined: Nov 17, 2003
Posts: 173
Actually, Eric, I just found some code (surprisingly) that seems to work ([URL=from]from[/url]):

Then somewhere in the body, here's the elements:

Granted, this only works well for IE, but in my workplace, that's all that's allowed. Thanks very much anyway. You're the first person to respond to any of my postings in a week!

The "o n l o a d" is actually one word, but it won't let me post as a single word.
Pat Flickner
Ranch Hand

Joined: Nov 17, 2003
Posts: 173
Wow. don't know why the code looks so small. And the URL surround didn't work right, so here's the uri:
I agree. Here's the link:
subject: Trying To Get File Date
It's not a secret anymore!