auto upload rename

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    auto upload rename

    PHP Code:
    function uploadfile($origin$dest$tmp_name)
    {
      
    $origin strtolower(basename($origin));
      
    $fulldest $dest.$origin;
      
    $filename $origin;
      for (
    $i=1file_exists($fulldest); $i++)
      {
       
    $fileext = (strpos($origin,'.')===false?'':'.'.substr(strrchr($origin"."), 1));
       
    $filename substr($origin0strlen($origin)-strlen($fileext)).'['.$i.']'.$fileext;
       
    $fulldest $dest.$newfilename;
      }
     
      if (
    move_uploaded_file($tmp_name$fulldest))
       return 
    $filename;
      return 
    false;

    i dont know where i can put this in uploader.php
    i want to make the upload file name will be

    kevin_uploadfile.ext
    Did I help you?
    You can help me too
    Your donations will help me finance my studies.

    #2
    lol bro, i told you that before. i thought you using that code.

    $filename = preg_replace("/$filename/", "kevin_".$filename."", $filename);

    or you may use $superdat_name instead of $filename, if you have lavalair. And put it on top of page, after the $filename or $superdat_name declaration.
    mysterio.al - programming is a functional art

    Comment


      #3
      Is This code only for lava ... How can i use it in auto index script

      Comment

      Working...
      X