在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" });