WebService: opening file in shared mode for concurrent access.

This commit is contained in:
Shreyas Zare
2020-09-06 16:52:02 +05:30
parent e7ba3ef3b0
commit 94faa268b7

View File

@@ -567,7 +567,7 @@ namespace DnsServerCore
private static async Task SendFileAsync(HttpListenerResponse response, string filePath)
{
using (FileStream fS = new FileStream(filePath, FileMode.Open, FileAccess.Read))
using (FileStream fS = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
response.ContentType = WebUtilities.GetContentType(filePath).MediaType;
response.ContentLength64 = fS.Length;