Link to home
Start Free TrialLog in
Avatar of JasLane
JasLane

asked on

Can I get the date a picture was taken from $FILES array?

Dear experts

I am working on an image file upload script that attempts to read the date the image was taken from the uploaded file array.

I found the 'filemdate' function on php.net and attempted to use it with the following results:

With filemdate($_FILES['ImgFile'][tmp_name]) this just returns the current date (I'm guessing because it was modified when uploaded to the temp dir).

With filemdate($_FILES['ImgFile'][name] I get: 'Warning: filemtime(): Stat failed for 100_0436.jpg (errno=2 - No such file or directory)'.

Can anyone help?

ASKER CERTIFIED SOLUTION
Avatar of CaveyCoUk
CaveyCoUk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JasLane
JasLane

ASKER

Thanks for clearing that up CaveyCoUk. The $exif_data doesn't work in all cases but is the best fit for my problem. Thanks!