Hi Guys,
I have a problem regarding the zip stream to save it in local drive. I don't want to use the File::SendUserFile because it creates another session and not be seen by user. What I am doing to do is going to save the zip file in local drive. Do you have any idea?
Here is my code below.
//Zip File
using(System.IO.MemoryStream zipArchiveStream = new System.IO.MemoryStream())
{
using (ZipArchive zipArchive = new ZipArchive(zipArchiveStream, ZipArchiveMode::Create, true))
{
ListEnumerator sb = lstSales.getEnumerator();
while(sb.moveNext())
{
BAMSalesOrderHeader header = sb.current() as BAMSalesOrderHeader;
ZipArchiveEntry dataFileEntry = zipArchive.CreateEntry(header.FileName());
using (System.IO.Stream dataFileEntryStream = dataFileEntry.Open())
{
this.ReadTextInList(header, dataFileEntryStream);
}
}
}
if(pathLocation != "")
{
//File::SendFileToUser(zipArchiveStream, package extensionZIP);
info("Operation Successfully");
}
CodeAccessPermission::revertAssert();
Thank you so much for your help.
Regards,
CJ