public static function cleanFileName($str)
    {
        preg_match('~\.\w{1,4}$~', $str, $ext);

        $str = preg_replace('~\.\w{1,4}$~', '', $str);

        return str_replace(Array(' ', '.', '-'), "_", $str).$ext[0];
    }