Questions tagged [system.io.compression]

a compression library for handling zip files and other formats built into .NET framework 4.5 or greater.

System.IO.Compression is a namespace provided as part of the .NET framework for handling some compressed file formats.

The formats supported are

  • GZip (stream)
  • Deflate (stream)
  • Zip

Full documentation can be found on MSDN's website at https://msdn.microsoft.com/en-us/library/system.io.compression(v=vs.110).aspx

64 questions
0
votes
1 answer

Difficulty Accessing Visible Property Using System.IO.Compression.ZipArchive by reflection

The Library loads and I am able to view the ziparchiveentries in the debugger but I can not access the methods or properties of the ziparchiveentry object array by reflection: Assembly CompressionLib =…
0
votes
0 answers

Unzip having file name non utf-8 is not extracting in correct name

I am extracting a zip file using system.io.compression in .net 4.5 var path = @""; using (ZipArchive zarc = ZipFile.Open(path, ZipArchiveMode.Read,Encoding.UTF8)) { var file= zarc.Entries.First().FullName; …
Debashish Saha
  • 318
  • 1
  • 12
0
votes
2 answers

C# Unable to unzip files zipped with CreateEntryFromFile

As per this post I'm zipping SQL backup files with the code below: using (ZipArchive zip = ZipFile.Open("test.bak", ZipArchiveMode.Create)) { zip.CreateEntryFromFile(@"c:\something.txt", "data/path/something.txt"); } The zip file are created…
Cameron Castillo
  • 2,712
  • 10
  • 47
  • 77
0
votes
1 answer

ExcelDataReader 3.4 - System.IO.FileLoadException

I'm using ExcelDataReader 3.4 and it work fine on my developer PC, but when used on production PC, I've got this error System.IO.FileLoadException: Could not load file or assembly 'System.IO.Compression, Version=4.2.0.0, Culture=neutral,…
Raphael
  • 813
  • 1
  • 8
  • 17
0
votes
2 answers

How can i generate and download zip file from server in angularJs application?

My code is below: [System.Web.Mvc.HttpPost] public ActionResult DownloaZipFile([FromBody] int id) { var result = _service.GetDocuments(id); var downloadFileName = $"Report{id}.zip"; var downloadFilePath =…
0
votes
1 answer

How can I update each file in a ZIP archive?

When trying the following I get the error "Collection was modified; enumeration operation may not execute.". How can I loop through Zip entries and update them? using (ZipArchive archive = ZipFile.Open(@"c:\file.zip",ZipArchiveMode.Update)) { …
Andrew Arthur
  • 1,563
  • 2
  • 11
  • 17
0
votes
0 answers

ZipArchive missing whitespaces?

i don't know how to explain my issue, but i'm gonna try. i have a batch services that creates several text files and put them in a zip file. there are two files that have a lot of white spaces. we are talking about thousand of white spaces between…
Rothariger
  • 293
  • 3
  • 22
0
votes
1 answer

Find Encoding type of DeflateStream

I have a zip file with a csv file inside it. I am using following code to read the file: using (ZipArchive zipArchive = ZipFile.OpenRead(filePath)) { var zipArchiveEntry = zipArchive.GetEntry("File.csv"); var zipEntry =…
lerner1225
  • 862
  • 7
  • 25
0
votes
0 answers

Reading a 3.9GB zip file using c# .net4.5 ZipArchive System.IO.Compression

When I try to read the files contained in a large zip file (expands to 3.9GB) using ZipArchive, I get an InvalidDataException exception "The archive entry was compressed using an unsupported compression method" on the StreamReader line. using…
HandyHowie
  • 231
  • 2
  • 6
0
votes
1 answer

ZipArchive ZipFile not compressing

I am using the System.IO.Compression in .net 4.5 and ZipArchive and ZipFile are used to add txt files to the archive. There are around 75 files . The files when put in a folder and measured the size, it was around 15 KB But when used to put in…
rahulmr
  • 681
  • 1
  • 7
  • 19
0
votes
0 answers

ClickOnce Application missing System.IO.Compression

I have a ClickOnce App which references System.IO.Compression, the reference being managed by NuGet. System.IO.Compression is (my default) marked with Copy Local = True, and indeed it is copied to the bin folder. However the Publish\Application…
The Gardener
  • 121
  • 1
  • 7
0
votes
1 answer

How to store a pdf within a zip file, without saving it locally

I have a zip file within a zip file and inside the inner zip file I have an Excel and a PDF/Tif document. I'm currently developing a tool that reads all these files and store them in the database. Before I used to store both files on a folder first,…
Jordec
  • 1,516
  • 2
  • 22
  • 43
0
votes
1 answer

I get an error in my MVC project (system.ıo.compression.CompressioLevel)

MVC project adding Roxy Manager plugin (CKEditor Plugin) I get an error on the C # side. How can I solve the problem.
0
votes
1 answer

Zip files not getting created by System.IO.Compression

Can System.IO.Compression assembly create zip files of some specific files like .txt, .bak or it simply create zip file of directory? I am not being able to craete zip files of specific files but rather only the zip file of directory is getting…
0
votes
0 answers

Excel zip packaging using System.IO.Compression

I'm creating an excel file (xlsx) based on Office Open XML. This is how my code looks like. string basePath = Util.GetAppDirectoryPath (); string excelDirectory = Path.Combine (basePath, "temp", "xlsx"); …