This commit is contained in:
2019-10-21 23:51:11 +00:00
parent fc77158f25
commit 8c8cb7bd6e

View File

@@ -1,24 +1,13 @@
using System; using System;
using System.Threading.Tasks; 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.IO;
using System.Text; using System.Text;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.WebUtilities; using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using AyaNova.Models; using AyaNova.Models;
using AyaNova.Api.ControllerHelpers;
using AyaNova.Util; using AyaNova.Util;
using AyaNova.Biz;
namespace AyaNova.Api.ControllerHelpers namespace AyaNova.Api.ControllerHelpers
@@ -34,8 +23,6 @@ namespace AyaNova.Api.ControllerHelpers
internal static class ApiUploadProcessor internal static class ApiUploadProcessor
{ {
/// <summary> /// <summary>
/// Process uploaded attachment file /// Process uploaded attachment file
/// Will be treated as a temporary file for further processing into database /// Will be treated as a temporary file for further processing into database
@@ -113,7 +100,8 @@ namespace AyaNova.Api.ControllerHelpers
//save to disk //save to disk
using (var stream = new FileStream(filePathAndName, FileMode.Create)) 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() result.UploadedFiles.Add(new UploadedFileInfo()
{ {