动态切换存储修改路径
This commit is contained in:
+2
-3
@@ -49,7 +49,7 @@ namespace IRaCIS.Core.API
|
||||
|
||||
var isDicomFile = path.Contains($"{StaticData.Folder.DicomFolder}");
|
||||
|
||||
var defaultFileProvider = new PhysicalFileProvider(iRaCISDefaultDataFolder);
|
||||
var defaultFileProvider = new PhysicalFileProvider(FileStoreHelper.GetIRaCISRootPath(_hostingEnv));
|
||||
var staticFileOptions = new StaticFileOptions
|
||||
{
|
||||
FileProvider = defaultFileProvider,
|
||||
@@ -65,12 +65,11 @@ namespace IRaCIS.Core.API
|
||||
{
|
||||
if (defaultFileProvider.GetFileInfo(context.Request.Path).Exists)
|
||||
{
|
||||
//var staticFileMiddleware = new StaticFileMiddleware(_next, _hostingEnv, Options.Create(staticFileOptions), _loggerFactory);
|
||||
//await staticFileMiddleware.Invoke(context);
|
||||
|
||||
var actrualPath = defaultFileProvider.GetFileInfo(context.Request.Path).PhysicalPath;
|
||||
|
||||
await context.Response.SendFileAsync(new PhysicalFileInfo(new FileInfo(actrualPath)));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user