This content has been marked as final. Show 5 replies
I don't think this is possible without a Java/ActiveX. You may be able to read the file dates with JScript using the FSO object in IE and the UniversalXPConnect in Mozilla but your still going to encounter security settings issues. CF is just taking the HTTP file upload field which only sends the "Content-Type" in the header, so CF just uses the dates when the file is written to the server. You would have thought whoever designed the RFC1867 HTTP File Upload specification would have included the date created, last accessed, last modified, size, readonly and hidden file properties, well maybe in HTML 5.x.
It would not be a CF bug. When the file is uploaded, there is limited information sent with it through the browser. This is a security issue between the client computer and the web server. This is limited to protect the user. The TimeCreated and TimeLastModified are for reading the dates for the file you just created on the local web browser.
In order to do this, you would have to find a way to capture the 'lastmodifieddate' from the file before it is sent by the form, and set a form field to that date and time. Off the top of my head I could only think that VBscript 'might' be able to do it. I would research at Microsoft for a script that returns that value 'onChange'.
Hope this helps
thanks - but I can't hope that all users' browsers have such security settings that I would be able to perform file operations on local computer - even reading. Also I try to support various versions of browsers, including Opera... It also complicates the task.
as far as I know - vbscript is supported by IE only, unlike to jscript. Moreover - anyway I would need to instanciate objects moissani has mentioned about - to get the corresponding file properties. But this is 'dead end' in common case, because of browser security settings...
So, I make conclusion, creation date and last modified dates are sensless fields. I could use only upload date instead...
(or make user to fill fields: file creation date, file modification date - see in file manager and retype :) ... )
And yes, it's already high time to make http header information more extended, appending such useful things as file creation and modification dates
I know you probably cannot use this in your application but here's something for your code vault. Also, check out "DSOleFile.PropertyReader" and "Shell.Application" for even more extended properties.
I'm sure something exist, but if not, an applet can be written. If I locate anything I'll post my findings.
Thanks for your reply, moissani. But please, don't bother to look for - currently I've left only upload date and client was not against as yet. So let it be like it is for now...
As to java applet - yes, in principle it's possible to do if it's obligatory... I don't do programming in Java, but I used to write java applet for uploading files to server with resume/zipping on run feature, when I had no other way :) I signed applet by myself and it was just a dialog box for the user to accept it in order to access local files...