wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Trying To Get File Date" Watch "Trying To Get File Date" New topic
Author

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.
...next file
...next 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.

Pat
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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.

Eric
Pat Flickner
Ranch Hand

Joined: Nov 17, 2003
Posts: 173
Actually, Eric, I just found some code (surprisingly) that seems to work ([URL=from http://www.getelementbyid.com/demo/LastModified/]from http://www.getelementbyid.com/demo/LastModified/[/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:

www.getelementbyid.com/demo/LastModified/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying To Get File Date
 
Similar Threads
NullPointerException in JSP after calling Servlet method
JSP EDITOR QUETION? NEED HELP
tiles description tag doesn't work
HTML link
how to I check when a file was last modified ????