• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cffile date

Guest
Sep 09, 2007 Sep 09, 2007

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

445

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Sep 11, 2007 Sep 11, 2007
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 ...

Votes

Translate

Translate
Community Beginner ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

LATEST
Exellent! I will look into EXIF data. That should work. Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation