diff --git a/server/AyaNova/ControllerHelpers/ApiUploadProcessor.cs b/server/AyaNova/ControllerHelpers/ApiUploadProcessor.cs index fdde5067..ba0a1f48 100644 --- a/server/AyaNova/ControllerHelpers/ApiUploadProcessor.cs +++ b/server/AyaNova/ControllerHelpers/ApiUploadProcessor.cs @@ -1,24 +1,13 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Routing; -using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.Logging; -using Microsoft.EntityFrameworkCore; -using System.Globalization; using System.IO; using System.Text; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.WebUtilities; using Microsoft.Net.Http.Headers; using System.Collections.Generic; -using System.Linq; using AyaNova.Models; -using AyaNova.Api.ControllerHelpers; using AyaNova.Util; -using AyaNova.Biz; namespace AyaNova.Api.ControllerHelpers @@ -34,8 +23,6 @@ namespace AyaNova.Api.ControllerHelpers internal static class ApiUploadProcessor { - - /// /// Process uploaded attachment file /// Will be treated as a temporary file for further processing into database @@ -113,7 +100,8 @@ namespace AyaNova.Api.ControllerHelpers //save to disk using (var stream = new FileStream(filePathAndName, FileMode.Create)) { - section.Body.CopyTo(stream); + await section.Body.CopyToAsync(stream); + //section.Body.CopyTo(stream); } result.UploadedFiles.Add(new UploadedFileInfo() {