Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (MemoryStream outputZip = new MemoryStream())
- {
- using (ZipOutputStream zipstream = new ZipOutputStream(outputZip))
- {
- zipstream.Password = req.password;
- zipstream.SetLevel(3);
- foreach (var doc in loadocs)
- {
- ZipEntry entry = new ZipEntry(doc.FileName);
- zipstream.PutNextEntry(entry);
- zipstream.Write(doc.FileData, 0, doc.FileData.Length);
- }
- zipstream.CloseEntry();
- zipstream.IsStreamOwner = false;
- }
- response.result = new Document()
- {
- name = doc1.Custodian + DateTime.Now.Date.ToString().Replace('/', '_').Replace(':', '_') + ".zip",
- content = outputZip.ToArray()
- };
- }
Add Comment
Please, Sign In to add comment