SEBWIN-409: Fixed handling of spaces in FileResourceSaver.

This commit is contained in:
Damian Büchel 2020-06-22 10:55:26 +02:00
parent 5cefbc5a7b
commit bcb8abdeaa

View file

@ -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);