app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = new…
- User
app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = new FileExtensionContentTypeProvider { Mappings = { [".7z"] = "application/x-7z-compressed" } } });让7z结尾的文件变成浏览器可下载文件
Assistant
在 ASP.NET Core 中,使用
app.UseStaticFiles中间件可以配置静态文件的处理。为了确保 文件可以被浏览器识别并下载,你需要配置一个自定义的 ,这样浏览器就能识别 文件的 MIME 类型。
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.