Bug: creating file output stream to an invalid path causes indefinite stall.

This commit is contained in:
femsci 2023-03-08 23:49:46 +01:00
parent b41508e472
commit 61725b4d07
Signed by: femsci
GPG key ID: 08F7911F0E650C67

View file

@ -23,7 +23,14 @@
{
_umsg = $"Uploading {counter}/{e.FileCount} files...";
StateHasChanged();
Console.WriteLine($"Fos: /tmp/uploads/{file.Name}");
if (!System.IO.Directory.Exists("/tmp/uploads"))
{
System.IO.Directory.CreateDirectory("/tmp/uploads");
}
Console.WriteLine($"fosse");
await using var fos = System.IO.File.OpenWrite($"/tmp/uploads/{file.Name}");
Console.WriteLine("Fos opened");
await file.OpenReadStream(1024 * 1024 * 10).CopyToAsync(fos);
Console.WriteLine($"File: /tmp/uploads/{file.Name} written...");
++counter;