C
Join ServerC#
help
❔ Not able to read Entries of a zip file
Aaleteia_learner12/15/2022
Hello everyone 🙂
I am trying to read a zip file in a dotnet Framework 4.7.2 Project using the code below:
However I get an exception saying "Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory."
I can't seem to figure why this is happening.
I tested the file using 7zip and noticed this warning:
warning 16-bit overflow for number of files in headers
Have added some screenshots for reference.
This is the link to the zip file I'm using: https://easyupload.io/gx66wn
Would be grateful if someone pointed me in the right direction here 🙂
I am trying to read a zip file in a dotnet Framework 4.7.2 Project using the code below:
using(var archive = new ZipArchive(stream)) {
//get all the xml applicant files in the zip
var xmlRepresentativeFiles = archive.Entries.Where(ent => Path.GetExtension(ent.Name) == ".xml").ToList();
}
However I get an exception saying "Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory."
I can't seem to figure why this is happening.
I tested the file using 7zip and noticed this warning:
warning 16-bit overflow for number of files in headers
Have added some screenshots for reference.
This is the link to the zip file I'm using: https://easyupload.io/gx66wn
Would be grateful if someone pointed me in the right direction here 🙂
CCisien12/15/2022
Bad zip file?
AAccord12/16/2022
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.