Compress file with dotnetzip, and when open it is corrupted
I create a zip file in a controller from a byte array and I return the zip file as a fileresult. When I download the zip File and extract the file, it is corrupt. I'm doing it this way: byte[] fileBytes =array MemoryStream fileStream = new MemoryStream(fileBytes); MemoryStream outputStream = new MemoryStream(); fileStream.Seek(0, SeekOrigin.Begin); using (ZipFile zipFile = new ZipFile()) { zipFile.AddEntry(returnFileName, fileStream); zipFile.Save(outputStream); } outputStream.Position = 0; FileStreamResult fileResult = new FileStreamResult(outputStream, System.Net.Mime.MediaTypeNames