在Program.cs中加入配置
app.UseStaticFiles();
// 在这里,我们指定了自定义的静态文件目录 "/custom-static"
app.UseStaticFiles(new StaticFileOptions
{
    FileProvider = new Microsoft.Extensions.FileProviders.PhysicalFileProvider(System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "UploadFile")),
    RequestPath = "/UploadFile"
});

 

posted on 2024-03-15 09:08  邢帅杰  阅读(129)  评论(0编辑  收藏  举报