private function generateNewFilename()
    {
        $time = time();
        $filename = $this->filename;
        $ext =  end(explode(".", $filename));
        do {
            $filename = substr(md5($filename. $time), 0, 8) . '.' . $ext;
        } while (file_exists($this->uploadDirectory . DIRECTORY_SEPARATOR . $filename));
        return $filename;
    }
private function generateNewFilename()
    {
        $time = time();
        $filename = $this->filename;
        $ext =  end(explode(".", $filename));
        do {
            $filename = substr(md5($filename. $time), 0, 8) . '.' . $ext;
        } while (file_exists($this->uploadDirectory . DIRECTORY_SEPARATOR . $filename));
        return $filename;
    }
private function generateNewFilename ( ) { $ time = time ( ) ; $ filename = $ this -> filename ; $ ext = end ( explode ( "." , $ filename ) ) ; do { $ filename = substr ( md5 ( $ filename . $ time ) , 0 , 8 ) . '.' . $ ext ; } while ( file_exists ( $ this -> uploadDirectory . DIRECTORY_SEPARATOR . $ filename ) ) ; return $ filename ; }
Auto generate new random file name

@return string
Auto generate new random file name