1

I have an application to upload files to a server.
However, when the files are uploaded, the "Date Modified" changes to the current date/time.

Is there a way to preserve the date of the uploaded file? Or is there a way to change the Date Modified on the uploaded file?

The only answer I have found so far uses Java and dates back to 2006 CFFile and Last Modified Date. Is there a better way to do the same now?

Gaurav S
  • 999
  • 8
  • 16
  • 1
    Native CFML doesn't give one the control over a file that is necessary to perform this action: you *will* need to drop down to Java, yes. – Adam Cameron Jul 29 '14 at 05:31

1 Answers1

2

A basic html file upload does not provide the original modification date from the client o/s. However, there is a simpler way to change the modified date of server files, as of CF9+: FileSetLastModified().

FileSetLastModified(result.serverDirectory &"/"& result.serverFile, dateValue )
Leigh
  • 28,765
  • 10
  • 55
  • 103