code: func initUploadHandler(auditConfig services.AuditConfig) (events.UploadHandler, error) {
  	if auditConfig.AuditSessionsURI == "" {
  		return nil, trace.NotFound("no upload handler is setup")
  	}
  	uri, err := utils.ParseSessionsURI(auditConfig.AuditSessionsURI)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	switch uri.Scheme {
  	case teleport.SchemeS3:
  		region := auditConfig.Region
  		if uriRegion := uri.Query().Get(teleport.Region); uriRegion != "" {
  			region = uriRegion
  		}
  		handler, err := s3sessions.NewHandler(s3sessions.Config{
  			Bucket: uri.Host,
  			Region: region,
  			Path:   uri.Path,
  		})
  		if err != nil {
  			return nil, trace.Wrap(err)
  		}
  		return handler, nil
  	case teleport.SchemeFile:
  		if err := os.MkdirAll(uri.Path, teleport.SharedDirMode); err != nil {
  			return nil, trace.ConvertSystemError(err)
  		}
  		handler, err := filesessions.NewHandler(filesessions.Config{
  			Directory: uri.Path,
  		})
  		if err != nil {
  			return nil, trace.Wrap(err)
  		}
  		return handler, nil
  	default:
  		return nil, trace.BadParameter(
  			"unsupported scheme for audit_sesions_uri: %q, currently supported schemes are %q and %q",
  			uri.Scheme, teleport.SchemeS3, teleport.SchemeFile)
  	}
  }
docs: // initUploadHandler initializes upload handler based on the config settings,
  // currently the only upload handler supported is S3
  // the call can return trace.NotFOund if no upload handler is setup