Skip to content

Commit 497d22d

Browse files
committed
FileLoader can use root path
1 parent b3ee8bd commit 497d22d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ImageWizard.Core/Loaders/Files/FileLoader.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ public FileLoader(IOptions<FileLoaderOptions> options, IWebHostEnvironment hosti
1818
{
1919
HostingEnvironment = hostingEnvironment;
2020

21-
FileProvider = new PhysicalFileProvider(Path.Join(HostingEnvironment.ContentRootPath, options.Value.Folder));
21+
if (Path.IsPathRooted(options.Value.Folder))
22+
{
23+
FileProvider = new PhysicalFileProvider(options.Value.Folder);
24+
}
25+
else
26+
{
27+
FileProvider = new PhysicalFileProvider(Path.Join(HostingEnvironment.ContentRootPath, options.Value.Folder));
28+
}
2229
}
2330

2431
/// <summary>

0 commit comments

Comments
 (0)