protected function trimFilename($name, $type, $index, $content_range)
    {
        $name = trim(basename(stripslashes($name)), ".\x00..\x20");

        if (! $name) {
            $name = str_replace('.', '-', microtime(true));
        }

        return $name;
    }