From 8c8cb7bd6ea5b17ec8edcb69a3d98103da7d87e5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 21 Oct 2019 23:51:11 +0000 Subject: [PATCH] --- .../ControllerHelpers/ApiUploadProcessor.cs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) 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() {