Page 1 of 1

How to add Date and Time in Uploaded Image.

Posted: Tue Jun 30, 2009 8:03 am
by manojsemwal1
Hai friend anybody know that how to add date and time to uploaded image
my script are like:

Code: Select all

 
                $path= move_uploaded_file($_FILES["file"]["tmp_name"],
              "upload/" . $_FILES["file"]["name"]);
              //echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
              $path="upload/" . $_FILES["file"]["name"];
              echo "manoj".$path;
 
here where we have to add date and time.

regards,
Manoj

Re: How to add Date and Time in Uploaded Image.

Posted: Tue Jun 30, 2009 12:42 pm
by Eric!
What do you want to add the date and time to?

You can get the files information using filemtime

Code: Select all

if (file_exists ($file))
      {
        $time = filemtime ($file);
        $year = date ("Y", $time);
        $month = date ("m", $time);
        $day = date ("d", $time);
        $hour = date ("H", $time);
        $minutes = date ("i", $time);
        $seconds = date ("s", $time);
 
        echo $year . $month . $day . '_' . $hour . $minutes . $seconds . "\n";
      }

how to rename file while uploading in the server

Posted: Wed Jul 01, 2009 12:01 am
by manojsemwal1
pl tell me how te rename file while uploading in the server......