File Upload Time Tracking Problem By PHP From Linux Server Hosting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imrantbd
    New Member
    • Aug 2006
    • 9

    File Upload Time Tracking Problem By PHP From Linux Server Hosting

    Hi this is Imran,

    I am facing some problem to track file upload time in a linux hosting. I used filectime / filemtime to track date. But I get the time stamp of locally file creation time.I can not track file upload time in linux server. Is there any way to track time
    without filectime / filemtime or without use of any database tracking.

    Thank to all advanced.
    Last edited by imrantbd; Jul 5 '07, 09:35 AM. Reason: Title Edit
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Imran.

    Try touch()ing the file when it gets uploaded.

    Comment

    • imrantbd
      New Member
      • Aug 2006
      • 9

      #3
      Thank u pbmods for reply. But I still can not capture the upload time stamp.
      My code is following :

      [code=php] <?php

      function DirDisply($data ) {

      $array_date_mai n = array();

      $file = ".";
      $TrackDir=opend ir($file);

      $i = 0;
      while ($file2 = readdir($TrackD ir)) {
      if (filetype($file 2) != "file" && $file2 != "." && $file2 != "..")
      {
      $array_date = getdate(filecti me($file2));
      $date_year = $array_date["year"];
      $date_mon = $array_date["mon"];
      $date_mday = $array_date["mday"];
      $date_hours = $array_date["hours"];
      $date_minutes = $array_date["minutes"];
      $date_seconds = $array_date["seconds"];

      $array_date_mai n[$i] = $file2."-".$date_yea r."/".$date_mon ."/".$date_mda y."/".$date_hou rs."/".$date_minutes ."/".$date_seconds ;

      reset($array_da te_main);
      $i++;
      }

      else {

      }

      }



      for($a=0; $a<=5; $a++)
      {

      echo "<a href='index.php ?page=1&p=$arra y_date_main[$a]'>".$array_date _main[$a]."</a><br>";
      }


      closedir($Track Dir);
      return $data;
      }

      ?>
      <?
      @ DirDisply($data );

      ?> [/code]

      [Please use CODE tags when posting source code. Thanks! --pbmods]

      It show the result like :
      69-2007/7/5/5/46/35
      Bhober_Haat-2007/7/5/5/46/35
      Nire_Tar_Neel_D ew-2007/7/5/5/46/35
      Amader_Ananda_B ari-2007/7/5/5/46/35
      Kacher_Manush-2007/7/5/5/46/35
      Ditio_Jibon-2007/7/5/5/46/35

      Here in all case result show 2007/7/5 that is not directory upload time actually.
      What can I do if I want to track actual directory upload time. Thank u all again in advanced

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, Imran.

        Try using filemtime() instead of filectime().

        Comment

        Working...