}
// GET: /<controller>/
- public IActionResult Index(string partial_name)
+ public IActionResult Index()
{
if (string.IsNullOrEmpty(HttpContext.Session.GetString("lang")))
{
session.SetString("lang", "kr");
}
- if (string.IsNullOrEmpty(partial_name))
- ViewData["partial_page"] = "partial_zip";
- else
- ViewData["partial_page"] = partial_name;
return View();
}
return Redirect("/");
}
+ public IActionResult SetPartial(string partial_name)
+ {
+ session.SetString("partial", partial_name);
+ return Redirect("/");
+ }
+
//파일업로드 사이즈 3GB (3(GB) * 1024(MB) * 1024(KB) * 1024(byte))
[RequestSizeLimit(3221225472)]
public ActionResult FileUpload(string dirList, List<IFormFile> files, string fileKeyPair, string format, string uuid)
{
JObject keyPair_FileDir = JObject.Parse(fileKeyPair);
- Console.WriteLine(dirList);
+ // Console.WriteLine(dirList);
Dictionary<string, object> data = new Dictionary<string, object>();
ZipModel zipModel = new ZipModel();
string[] listDir = dirList.Split(',');
string filename = listDir[0] + "." + format;
- zipModel.SetParam(keyPair_FileDir, listDir, files, uuid, uuid);
+ zipModel.SetParam(keyPair_FileDir, listDir, files, uuid);
zipModel.MakeZip();
return Json("");
-using System;
+using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
private List<IFormFile> files;
double nows;
double per;
- private string zipname;
public ZipModel () { }
- public void SetParam (JObject keypair, string[] dirList, List<IFormFile> files, string zipname, string uuid) {
+ public void SetParam (JObject keypair, string[] dirList, List<IFormFile> files, string uuid) {
this.keypair = keypair;
this.dirList = dirList;
this.files = files;
- this.zipname = zipname;
this.uuid = uuid;
}
byte[] b = null;
string filename = null;
string dir = null;
- string path = Environment.CurrentDirectory + "/wwwroot/zipfiles/" + zipname + ".zip";
+ string path;
+#if !DEBUG
+ path = Environment.CurrentDirectory + "/release/netcoreapp2.1/publish/wwwroot/zipfiles/";
+#else
+ path = Environment.CurrentDirectory + "/wwwroot/zipfiles/";
+#endif
+
using (var zip = new ZipFile (Encoding.UTF8)) {
foreach (IFormFile file in files) {
zip.SaveProgress += SaveProgress;
zip.AddEntry (dir + filename, file.OpenReadStream ());
}
- if (!Directory.Exists (Environment.CurrentDirectory + "/wwwroot/zipfiles/")) {
- Directory.CreateDirectory (Environment.CurrentDirectory + "/wwwroot/zipfiles/");
+ Console.WriteLine("here:"+path);
+ if (!Directory.Exists (path)) {
+ Directory.CreateDirectory (path);
}
+ path += uuid + ".zip";
+
zip.Save (path);
}
}
\r
<!-- language section -->\r
<script>\r
+ if((window.location+"").split('?').length != 0){\r
+ history.pushState(null, null, "/");\r
+ }\r
var lang= "@ViewData["lang"]";\r
var _Language;\r
$.ajax({\r
\r
<div class="col-sm-12 webzip-howtouse">\r
<div class="col-sm-12" style="text-align: left;">\r
- <partial name="@ViewData["partial_page"]_help" />\r
+ <partial name="@ViewData["partial"]_help" />\r
</div>\r
</div>\r
\r
\r
<div class="webzip-section-zipbutton">\r
<div class="btn-group btn-group-toggle" data-toggle="buttons">\r
- <label class="btn btn-danger btn-secondary" id="partial_zip" \r
+ <label class="btn btn-danger btn-secondary" id="partial_zip"\r
style="outline: none; width: 115px; color: black; background-color: #e5e5e5;\r
border: 1.5px solid #e5e5e5; font-weight: bold; font-size: 16px; border-top-left-radius: 10px; border-bottom-left-radius: 10px;">\r
<input type="radio" name="options" autocomplete="off" /> @LanguagePack.GetText(lang, "zip")\r
<input type="radio" name="options" autocomplete="off" /> @LanguagePack.GetText(lang, "unzip")\r
</label> \r
</div>\r
- <form action="/webzip" method="post" id="frm1" name="frm1" style="display: none;">\r
+ <form action="/webzip/setpartial" method="post" id="frm1" name="frm1" style="display: none;">\r
<input name="partial_name" value="" id="partial_name" />\r
</form>\r
</div>\r
<div class="webzip-section-zip" id="section_zip">\r
- <partial name="@ViewData["partial_page"]" />\r
+ <partial name="@ViewData["partial"]" />\r
</div>\r
\r
</div>\r
@section Scripts{\r
\r
<script>\r
- var partial_page= "@ViewData["partial_page"]";\r
+ var partial_page= "@ViewData["partial"]";\r
</script>\r
\r
<script src="/static/js:Zip:Index.js" asp-append-version="true"></script>\r
var nY= e.changedTouches[0].pageY;\r
var nTime= e.timeStamp;\r
\r
- if ((htDragInfo.startY - nY <= 10 && htDragInfo.startY - nY >= -10) && htDragInfo.startX - nX < -30){\r
+ if ((htDragInfo.startY - nY <= 9 && htDragInfo.startY - nY >= -9) && htDragInfo.startX - nX < -30){\r
var menuX= parseInt($("#zipExplore").offset().top) + parseInt($("#toolbar_zipExplore").height()) + 5;\r
- var menuY= parseInt($("#zipExplore").offset().left) + parseInt($("#zipExplore").width()) * 0.5;\r
+ var menuY= parseInt($("#zipExplore").offset().left) + parseInt($("#zipExplore").width()) -100;\r
HideContextmenu();\r
event.preventDefault();\r
HideContextmenu();\r
$(GetMenu("mobile"))\r
.appendTo("body")\r
- .css({ top: menuX + "px", left: menuY + "px", 'z-index': '99999999' });\r
+ .css({ top: menuX + "px", left: menuY + "px", 'z-index': '999' });\r
}\r
\r
if(bStartEvent && !bMoveEvent) {\r
<div class="col-sm-12 webzip-section-sidezip webzip-section-explore" id="zipExplore"\r
style="border: 0px solid lightgray; overflow-x: auto; white-space: nowrap; text-align: left; padding: 0; background-color: #f9f9f9f9;\r
border-radius: 10px;">\r
- <div style="background-color: lightgray; padding-left: 10px; padding-right: 10px; height: 25px; line-height: 2; margin-bottom: 5px; position: sticky; top: 0px;" id="toolbar_zipExplore">\r
+ <div style="background-color: lightgray; padding-left: 10px; padding-right: 10px; height: 25px; line-height: 2; margin-bottom: 5px; position: sticky; top: 0px; z-index:1" id="toolbar_zipExplore">\r
<i class="fas fa-dot-circle" style="color: rgb(251, 64, 65);"></i>\r
<i class="fas fa-circle" style="color: rgb(223, 181, 33);"></i>\r
<i class="fas fa-circle" style="color: rgb(70, 186, 33);"></i>\r
</li>
<li>
@LanguagePack.GetText(lang, "guide2")
- <br>
- @LanguagePack.GetText(lang, "guide2-1")
</li>
<li>
@LanguagePack.GetText(lang, "guide3")
<li>
@LanguagePack.GetText(lang, "guide4")
</li>
+ <li>
+ @LanguagePack.GetText(lang, "guide5")
+ </li>
</ul>
\ No newline at end of file
-@using ZipProject\r
+@using ZipProject\r
@using ZipProject.Models\r
@using Microsoft.AspNetCore.Http\r
@using Microsoft.AspNetCore.Mvc\r
-@inject IHttpContextAccessor httpContextAccesor\r
+@inject IHttpContextAccessor httpContextAccesor\r
@{\r
Layout = "_Layout";\r
ViewData["lang"] = httpContextAccesor.HttpContext.Session.GetString("lang");\r
+ ViewData["partial"] = String.IsNullOrEmpty(httpContextAccesor.HttpContext.Session.GetString("partial")) ? "partial_zip" : httpContextAccesor.HttpContext.Session.GetString("partial");\r
}\r
"usersguide": "User's Guide",
"guide1": "1. Click on the file to select it.",
"guide2": "2. The file can be dragged into the folder. <br> ",
- "guide2-1": " * When you export to the top-level directory, drag it to the top-level label.",
"guide3": "3. Folder is folded when double-clicked and opens when double-clicking again.",
"guide4": "4. Right-click contextmenu appears.",
+ "guide5": "5. For mobile users, the directory function is not possible, and the menu is dragged to the right.",
"complate": "Complate",
"pleasewait": "Compressing files Please wait.",
"iscompress": "proceed with compression? FileSize: ",
"toolargesize": "The capacity of the files exceeds the maximum file size of 2 GB and can not proceed.",
"nofilesadded": "No files added.",
- "footIntroduce": "Easy and convenient file compression! Please find NiceZip."
+ "footIntroduce": "Easy and convenient file compression! Please find NiceZip.",
+ "removefilefolder": "remove file,directory"
}
"renameDir": "폴더이름변경",
"renameZip": "압축파일이름변경",
"usersguide": "사용설명서",
- "guide1": "1. 파일은 클릭하셔서 선택하실 수 있습니다.",
+ "guide1": "1. 파일은 클릭하셔서 선택하실 수 있습니다",
"guide2": "2. 파일은 폴더 속으로 드래그시킬 수 있습니다",
- "guide2-1": " * 최상위 디렉토리로 꺼낼땐 최상위 라벨에 드래그해야합니다.",
- "guide3": "3. 폴더는 더블클릭시 접히며 다시 더블클릭할시 열립니다.",
- "guide4": "4. 우클릭시 메뉴가 나타납니다.",
+ "guide3": "3. 폴더는 더블클릭시 접히며 다시 더블클릭할시 열립니다",
+ "guide4": "4. 우클릭시 메뉴가 나타납니다",
+ "guide5": "5. 모바일사용자는 디렉토리이동은 불가하며, 메뉴는 오른쪽으로 드래그하시면 나옵니다",
"complate": "완료",
"pleasewait": "압축중입니다 잠시만 기다려주세요.",
"iscompress": "압축을 진행하시겠습니까? FileSize: ",
"toolargesize": "파일들의 용량이 최대파일크기인 2GB를 넘어가서 진행할 수 없습니다.",
"nofilesadded": "추가된 파일이 없습니다.",
- "footIntroduce": "쉽고 편리한 압축! NiceZip을 찾아주세요."
+ "footIntroduce": "쉽고 편리한 압축! NiceZip을 찾아주세요.",
+ "removefilefolder": "파일,폴더 제거"
}
\r
.body-content {\r
margin-top: 11px;\r
+ margin-bottom: 60px;\r
}\r
\r
.webzip-bodycontainer {\r
margin-right: 5px; \r
position: relative; \r
text-align: center;\r
- top: 375px;\r
- right: 20px;\r
+ top: 5px;\r
+ right: 5px;\r
}\r
.webzip-btn-complate div {\r
background-color: rgb(255, 100, 100);\r
position: absolute;\r
top: -1px;\r
}\r
+}\r
+\r
+footer {\r
+ position: fixed;\r
+ bottom: 0px;\r
+ width: 100%;\r
+ z-index: 9999;\r
}
\ No newline at end of file
'<div class="webzip-btn" onclick="ClickChooseFiles();HideContextmenu();">' +
_Language["addFile"] +
"</div>";
- var rename =
- '<div class="webzip-btn" onclick="NameFormToggle();HideContextmenu();">';
- if (selected_nameChange != undefined && selected_nameChange.prev().attr('is') == 'zip'){
- rename += _Language["renameZip"];
- } else {
- rename += _Language["renameDir"];
- }
- rename += "</div>";
+ var remove =
+ '<div class="webzip-btn" onclick="alert('+_Language["comingsoon"]+');HideContextmenu();">' +
+ _Language["removefilefolder"] +
+ "</div>";
+ var rename = ''
+ // rename= '<div class="webzip-btn" onclick="NameFormToggle();HideContextmenu();">';
+ // if (selected_nameChange != undefined && selected_nameChange.prev().attr('is') == 'zip'){
+ // rename += _Language["renameZip"];
+ // } else {
+ // rename += _Language["renameDir"];
+ // }
+ // rename += "</div>";
+++ /dev/null
-Could not execute because the specified command or file was not found.\r
-Possible reasons for this include:\r
- * You misspelled a built-in dotnet command.\r
- * You intended to execute a .NET Core program, but dotnet-release/netcoreapp2.1/ZipProject.dll does not exist.\r
- * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
-cd ZipProject
+cd ~/.publish/nicezip/sources/ZipProject
dotnet publish --configuration ../../../release
cd ../../
./runserver