Jump to content

File Properties


saint959

Recommended Posts

Hi All,

 

I am new to this forum and am hoping that someone will be able to help me. I am writing an application that allows users to upload images to our server. which i have done fine, I then need to check the date that the image was created to confirm that it was taken as recently as possible. i.e. minutes before uploading the image.

 

The problem i am having is: when the file has been uploaded all the properties of the image are re-created because they get changed by the server during the upload process.(all the dates are the same as the submission of the form).  Is it possible to get the properties of the image before the server changes the creation date?

 

I hope this makes sense, and any help will be hugely appreciated!

Link to comment
Share on other sites

You may find that all those details are lost as the file will be recreated on the server after uploading, so the date created and modified will always show the time the file was uploaded.

 

And I personally don't know of a way of reading meta data from a file on a remote computer, as the server will always make a copy of the file to the local machine.

 

But somebody else might....

Link to comment
Share on other sites

hi mjlogan, thanks for the reply.

 

Thats exactly what i thought the problem was going to be.

 

i am going to do more research on the meta data you mentioned. hopefully something will come from that. pls if anyone else has ideas please let me know.

 

thanks again

Link to comment
Share on other sites

Hi, i have managed to find this functions thanks to mjlogan's idea:

 

exif_read_data():

 

Does anyway one maybe have an idea how i can get out just a specific section of the function (or just one variable). I checked the PHP manual at (http://www.php.net/manual/en/function.exif-read-data.php) but i do not really understand what they say there. i have tried different combinations for the function without much success.

 

Here is a the section of code that displays all the photos meta information.

 

$exif = exif_read_data("photoname.jpg", 0, true);

 

foreach ($exif as $key => $section) {

    foreach ($section as $name => $val) {

        echo "$key.$name: $val<br/>";

    }

}

 

This then prints ALL the photos information whereas i only need one line of the above output.

If you would like to see the out put from the above code then let me know and ill paste it here ASAP.

 

Thanks again

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.