01.
[HttpPost]
02.
public
ActionResult Download(WhtSubmit SubmitInfo)
03.
{
04.
string
fileSavePath = System.Web.Hosting.HostingEnvironment.MapPath(
"~/documents/wht"
);
05.
DirectoryInfo dirInfo =
new
DirectoryInfo(fileSavePath);
06.
07.
08.
09.
using
(var memoryStream =
new
MemoryStream())
10.
{
11.
using
(var ziparchive =
new
ZipArchive(memoryStream, ZipArchiveMode.Create,
true
))
12.
{
13.
foreach
(var fileCol
in
SubmitInfo.AxVoucher)
14.
{
15.
ziparchive.CreateEntryFromFile(dirInfo.FullName+@
"\"
+ fileCol, fileCol);
16.
}
17.
}
18.
19.
return
File(memoryStream.ToArray(),
"application/zip"
,
"Attachments.zip"
);
20.
}
21.
}