public static function saveInputAsFile($content, $tmpDir = '', $key = '')
    {
        if (!$tmpDir) {
            $tmpDir = ini_get('upload_tmp_dir');
        }
        if (!is_dir($tmpDir)) {
            return false;
        }
        if (!$key) {
            $key = uniqid();
        }
        if (!$content) {
            return false;
        }
        $tmp_file = realpath($tmpDir) . '/' . $key;
        if (self::create($tmp_file, $content) > 0) {
            return ['name' => $key, 'path' => $tmp_file];
        } else {
            return false;
        }
    }