From: joinsang Date: Mon, 25 Feb 2019 12:32:37 +0000 (+0900) Subject: 프론트 이것저것 많이수정 X-Git-Url: https://git.insang.kr/gitweb/?a=commitdiff_plain;h=fc342702105ea24dc393169a6c3c0d15203ef6fc;p=ZipProject.git 프론트 이것저것 많이수정 압축파일명 인코딩 수정하다가 못했음 --- diff --git a/ZipProject/Models/ZipModel.cs b/ZipProject/Models/ZipModel.cs index dc2e3c2..97a5756 100644 --- a/ZipProject/Models/ZipModel.cs +++ b/ZipProject/Models/ZipModel.cs @@ -1,7 +1,8 @@ -using System.Linq; +using System.Text; using System; using System.Collections.Generic; using System.IO; +using System.Linq; using Ionic.Zip; using Microsoft.AspNetCore.Http; using Newtonsoft.Json.Linq; @@ -33,12 +34,12 @@ namespace ZipProject { path += "/"; Directory.CreateDirectory (path); - for (int i=1; i < dirList.Length; i++){ - string dirpath= path+ dirList[i]; + for (int i = 1; i < dirList.Length; i++) { + string dirpath = path + dirList[i]; exist = Directory.Exists (dirpath); - if (!exist){ - Directory.CreateDirectory(dirpath); + if (!exist) { + Directory.CreateDirectory (dirpath); } } @@ -60,23 +61,32 @@ namespace ZipProject { } private void RemoveFiles (string path) { - Directory.Delete(path, true); + Directory.Delete (path, true); } public MemoryStream MakeZip (JObject keypair, string[] dirList, List files) { string path = this.SaveFiles (keypair, dirList, files); + DirectoryInfo di = new DirectoryInfo(path); + FileInfo[] infos = di.GetFiles(); + string[] filesinfo = new string[infos.Length]; + + //파일인코딩 변경 ㅠㅠ + for (int i = 0; i < infos.Length; i++) + { + filesinfo[i] = infos[i].FullName; + } + byte[] b = null; + string d = null; + //여기까지 - MemoryStream memoryStream= new MemoryStream(); - + MemoryStream memoryStream = new MemoryStream (); using (ZipFile zip = new ZipFile ()) { zip.AddDirectory (path); zip.Name = dirList[0]; - zip.Save(memoryStream); + zip.Save (memoryStream); } - - this.RemoveFiles (path); return memoryStream; diff --git a/ZipProject/Program.cs b/ZipProject/Program.cs index 1a2bfd3..844fcfa 100644 --- a/ZipProject/Program.cs +++ b/ZipProject/Program.cs @@ -13,13 +13,16 @@ namespace ZipProject public class Program { public static void Main(string[] args) - { + { CreateWebHostBuilder(args).UseUrls("http://localhost:5001").Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup() + .UseKestrel(options => { + options.Limits.MaxRequestBodySize= null; + }); } } \ No newline at end of file diff --git a/ZipProject/Views/Shared/_Navbar.cshtml b/ZipProject/Views/Shared/_Navbar.cshtml index 41ec671..15bc04d 100644 --- a/ZipProject/Views/Shared/_Navbar.cshtml +++ b/ZipProject/Views/Shared/_Navbar.cshtml @@ -14,8 +14,7 @@ - @**@ - +