Skip to content

Commit

Permalink
默认提供文件下载器
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Sep 10, 2024
1 parent d3f1b50 commit 8ca6e70
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions SyncTool/Server/ServeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,19 @@ void OnCurrentFolderInfoChanged(object? sender, SyncFolderInfo e)
OutputStatus();
return new SyncCompletedResponse();
});
webApplication.UseStaticFiles(new StaticFileOptions()
webApplication.UseFileServer(new FileServerOptions()
{
FileProvider = new PhysicalFileProvider(syncFolder, ExclusionFilters.System),
ContentTypeProvider = new ContentTypeProvider(),
ServeUnknownFileTypes = true,
StaticFileOptions =
{
FileProvider = new PhysicalFileProvider(syncFolder, ExclusionFilters.System),
ContentTypeProvider = new ContentTypeProvider(),
ServeUnknownFileTypes = true,
RequestPath = StaticFileConfiguration.RequestPath,
RedirectToAppendTrailingSlash = true,
DefaultContentType = MediaTypeNames.Application.Octet,
},
RequestPath = StaticFileConfiguration.RequestPath,
RedirectToAppendTrailingSlash = true,
DefaultContentType = MediaTypeNames.Application.Octet,
EnableDirectoryBrowsing = true,
});

_ = Task.Run(() =>
Expand Down

0 comments on commit 8ca6e70

Please sign in to comment.