public async Task SaveFile(string name, Stream stream)
{
var fullPath = GetFullPath(name);
using (var fs = new FileStream(fullPath, FileMode.OpenOrCreate, FileAccess.Write))
{
await stream.CopyToAsync(fs).ConfigureAwait(false);
await stream.FlushAsync().ConfigureAwait(false);
await fs.FlushAsync().ConfigureAwait(false);
}
}