Skip to content

Commit

Permalink
Fix: sync save uploaded file
Browse files Browse the repository at this point in the history
  • Loading branch information
ixre committed May 25, 2020
1 parent 32a6679 commit 6fce66e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/JR.Stand.Core/Framework/Web/Utils/FileUpload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private static void InitUplDirectory(String baseDir, String absDir)
}
}

private void SaveStream(Stream stream, string path)
private async void SaveStream(Stream stream, string path)
{
const int bufferSize = 100; //缓冲区大小
byte[] buffer = new byte[bufferSize]; //缓冲区
Expand All @@ -104,7 +104,7 @@ private void SaveStream(Stream stream, string path)
{
while (true)
{
var bytes = stream.Read(buffer, 0, bufferSize); //从流中读取的值
var bytes = await stream.ReadAsync(buffer, 0, bufferSize); //从流中读取的值
if (bytes == 0)
{
break;
Expand Down

0 comments on commit 6fce66e

Please sign in to comment.