Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2007



Tip: Looking for answers? Try searching our database.

cffile date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jkw89 - 09 Sep 2007 19:26 GMT
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?
jhandfield - 11 Sep 2007 18:34 GMT
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 http://www.google.com/search?q=reading+EXIF+data+in+ColdFusion, or
http://www.easycfm.com/tutorials/pdf_output.cfm?tutorial_id=400&szExportType=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 http://www.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.
jkw89 - 13 Sep 2007 17:15 GMT
Exellent!  I will look into EXIF data.  That should work.  Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.