From bcb8abdeaa761ad7b4b17b0a87889d0724fb98f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Mon, 22 Jun 2020 10:55:26 +0200 Subject: [PATCH] SEBWIN-409: Fixed handling of spaces in FileResourceSaver. --- .../DataResources/FileResourceSaver.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SafeExamBrowser.Configuration/DataResources/FileResourceSaver.cs b/SafeExamBrowser.Configuration/DataResources/FileResourceSaver.cs index dda41d0d..7e62d70f 100644 --- a/SafeExamBrowser.Configuration/DataResources/FileResourceSaver.cs +++ b/SafeExamBrowser.Configuration/DataResources/FileResourceSaver.cs @@ -41,7 +41,7 @@ namespace SafeExamBrowser.Configuration.DataResources public SaveStatus TrySave(Uri destination, Stream data) { - var directory = Path.GetDirectoryName(destination.AbsolutePath); + var directory = Path.GetDirectoryName(destination.LocalPath); logger.Debug($"Attempting to save '{data}' with {data.Length / 1000.0} KB data as '{destination}'..."); @@ -51,7 +51,7 @@ namespace SafeExamBrowser.Configuration.DataResources Directory.CreateDirectory(directory); } - using (var fileStream = new FileStream(destination.AbsolutePath, FileMode.Create)) + using (var fileStream = new FileStream(destination.LocalPath, FileMode.Create)) { data.Seek(0, SeekOrigin.Begin); data.CopyTo(fileStream);