public function genFilePath($fieldName = null)
    {
        $id   = $this->countFiles($fieldName) + 1;
        $src  = null;
        $path = null;

        while (1) {
            $path = $id; //. "-" . System::generatePassword(12) ;
            $src  = $this->getFilePath($fieldName) . "/" . $path;
            if (!file_exists($src)) {
                break;
            }
            $id++;
        }

        return array(
            "src"  => $src,
            "path" => $path
        );
    }
public function genFilePath($fieldName = null)
    {
        $id   = $this->countFiles($fieldName) + 1;
        $src  = null;
        $path = null;

        while (1) {
            $path = $id; //. "-" . System::generatePassword(12) ;
            $src  = $this->getFilePath($fieldName) . "/" . $path;
            if (!file_exists($src)) {
                break;
            }
            $id++;
        }

        return array(
            "src"  => $src,
            "path" => $path
        );
    }
public function genFilePath ( $ fieldName = null ) { $ id = $ this -> countFiles ( $ fieldName ) + 1 ; $ src = null ; $ path = null ; while ( 1 ) { $ path = $ id ; //. "-" . System::generatePassword(12) ; $ src = $ this -> getFilePath ( $ fieldName ) . "/" . $ path ; if ( ! file_exists ( $ src ) ) { break ; } $ id ++ ; } return array ( "src" => $ src , "path" => $ path ) ; }
Generate unique file name for a field.

@param null $fieldName Field
@return string
@internal param string $extension File extension
Generate unique file name for a field .