Merge pull request #507 from iceljc/bugfix/fix-file-save

flush to disk
This commit is contained in:
C. Oceania 2024-06-19 12:45:46 -05:00 committed by GitHub
commit 75d92af9d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -227,10 +227,9 @@ public partial class BotSharpFileService
Directory.CreateDirectory(subDir);
}
using var fs = new FileStream(Path.Combine(subDir, file.FileName), FileMode.OpenOrCreate);
using var fs = new FileStream(Path.Combine(subDir, file.FileName), FileMode.Create);
fs.Write(bytes, 0, bytes.Length);
fs.Flush();
Thread.Sleep(2000);
fs.Flush(true);
}
return true;