|
|
|
@ -26,6 +26,7 @@ using VOL.Core.Filters;
|
|
|
|
|
using VOL.Core.Middleware;
|
|
|
|
|
using VOL.Core.ObjectActionValidator;
|
|
|
|
|
using ConvertHelper;
|
|
|
|
|
using Microsoft.AspNetCore.StaticFiles;
|
|
|
|
|
|
|
|
|
|
namespace VOL.WebApi
|
|
|
|
|
{
|
|
|
|
@ -183,8 +184,17 @@ namespace VOL.WebApi
|
|
|
|
|
//可以在此处读取请求的信息进行权限认证
|
|
|
|
|
// staticFile.File
|
|
|
|
|
// staticFile.Context.Response.StatusCode;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//FileProvider = new PhysicalFileProvider(Directory.GetCurrentDirectory()),
|
|
|
|
|
//设置不限制content-type 该设置可以下载所有类型的文件,但是不建议这么设置,因为不安全
|
|
|
|
|
//下面设置可以下载apk和nupkg类型的文件
|
|
|
|
|
ContentTypeProvider = new FileExtensionContentTypeProvider(new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ ".apk", "application/vnd.android.package-archive" },
|
|
|
|
|
{ ".png", "application/png" }
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//配置HttpContext
|
|
|
|
|
app.UseStaticHttpContext();
|
|
|
|
|
|
|
|
|
|