public static void AddMimeTypes(FileServerOptions opts,IList<string> tdefs) { var ctp = new Microsoft.Owin.StaticFiles.ContentTypes.FileExtensionContentTypeProvider(); foreach (var def in tdefs) { var d = def.Split(';'); ctp.Mappings["." + d[0]] = d[1]; } opts.StaticFileOptions.ContentTypeProvider = ctp; }
public static void AddMimeTypes(FileServerOptions opts, IList <string> tdefs) { var ctp = new Microsoft.Owin.StaticFiles.ContentTypes.FileExtensionContentTypeProvider(); foreach (var def in tdefs) { var d = def.Split(';'); ctp.Mappings["." + d[0]] = d[1]; } opts.StaticFileOptions.ContentTypeProvider = ctp; }