.net core如何访问项目外服务器上的共享文件夹
.net core how to access shared folder on server outside project
我正在构建一个小型应用程序并希望从项目外部的目录访问文件(图像),但在同一台服务器上该应用程序将 运行。
如何访问我想要的目录?
我在 Startup.cs 配置中使用了这个:
app.UseFileServer(new FileServerOptions()
{
FileProvider = new PhysicalFileProvider(env.ContentRootPath + "/Albums"),
RequestPath = new PathString("/Albums"),
EnableDirectoryBrowsing = true
});
来自应该使用它的模型:
Initialize(_environment.WebRootPath + "/Albums");
我正在构建一个小型应用程序并希望从项目外部的目录访问文件(图像),但在同一台服务器上该应用程序将 运行。
如何访问我想要的目录?
我在 Startup.cs 配置中使用了这个:
app.UseFileServer(new FileServerOptions()
{
FileProvider = new PhysicalFileProvider(env.ContentRootPath + "/Albums"),
RequestPath = new PathString("/Albums"),
EnableDirectoryBrowsing = true
});
来自应该使用它的模型:
Initialize(_environment.WebRootPath + "/Albums");