Commit 142a6c68 authored by Alessio Parma's avatar Alessio Parma

Update HttpDownloadManager.cs

parent dc5a541b
Pipeline #155990824 passed with stages
in 33 minutes and 32 seconds
......@@ -108,10 +108,11 @@ public async Task<TempFileDTO> DownloadFileAsync(Uri fileUri, CancellationToken
file = await _tempFileStore.GetTempFileAsync(file.ContentType, cancellationToken).ConfigureAwait(false);
_logger.LogDebug("File '{FileUri}' downloaded successfully, it will be stored at path '{FilePath}'", fileUri, file.Path);
using var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
using var fileStream = File.OpenWrite(file.Path);
await responseStream.CopyToAsync(fileStream, cancellationToken).ConfigureAwait(false);
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
using (var fileStream = File.OpenWrite(file.Path))
{
await responseStream.CopyToAsync(fileStream, cancellationToken).ConfigureAwait(false);
}
return await _tempFileStore.HandleFileDownloadAsync(file, cancellationToken).ConfigureAwait(false);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment