2 Replies Latest reply on Sep 13, 2007 9:15 AM by jkw89

    cffile date

    jkw89
      Using Coldfusion MX6.1. Have a site where members upload pictures using cffile. I would like to get the date of the picture from the clients computer. Using the variables FILE.DATELASTACCESSED and FILE.TIMELASTMODIFIED, both return todays date, which seems to be the date of the file on the server. If there was a variable call FILE.CLIENTFILEDATE, all would be great. Is there a way to get what I'm looking for?
        • 1. Re: cffile date
          jhandfield
          Unfortunately, I think you're going to be out of luck on that count; the browser's going to send the file data, but none of the metadata like create date, modified date, etc.

          However, you did mention that you're having people upload pictures, which presents a unique opportunity. Most, if not all, digital cameras add what's called EXIF data to the images they take, which contains all kinds of neat tidbits such as what model of camera took the picture, exposure settings, and even GPS information if the camera's capable! Also, lucky for you, the date and time the photo was taken (to the best of the camera's knowledge, of course; if the camera's blinking 12:00, it won't be too useful to you.)

          There are any number of ways to read and manipulate the EXIF data of a file you've received, some use COM, others are Java classes, some others are web services (though these would require you to send the user's photo to a third party, which may open a can of worms you don't want to.) You can try your luck with this Google search, or here's one PDF that explains how to make use of a Java class to read the information (note: I am not affiliated with Google or this other gent, they were just close by and looked helpful)

          Or, of course, the EXIF spec is available at EXIF.org should you be feeling adventurous and want to write your own code to read the data. Reinventing the wheel, sure, but there's something to be said for the journey, too.
          • 2. Re: cffile date
            jkw89 Level 1
            Exellent! I will look into EXIF data. That should work. Thanks!