public function getTempFile($keep = false, $ext = null)
    {
        $tmp = tempnam($this->tempPath, "tmp_");
        $tmpExt = '';
        if (!is_null($ext)) {
            $tmpExt .= ".{$ext}";
        }
        if (!$keep) {
            $this->_tempFiles[] = $tmp;
            if (!empty($tmpExt)) {
                $tmp = $tmp . $tmpExt;
                $this->_tempFiles[] = $tmp;
            }
        } else {
            if (!empty($tmpExt)) {
                $tmp = $tmp . $tmpExt;
            }
        }

        return $tmp;
    }