bad read of entry test.csv from compressed archive.

Jan 5, 2012 at 1:00 PM

I have a problem when trying to extract the zip file.
my code is below.

FileStream writeStream = new FileStream("", FileMode.Create);
int Length = 2048;
int i = (int)fileSize / 2048 + 1;
int j = 0;
Byte[] buffer = new Byte[Length];
int bytesRead = responseStream.Read(buffer, 0, Length);
while (bytesRead > 0)
writeStream.Write(buffer, 0, bytesRead);
bytesRead = responseStream.Read(buffer, 0, Length);
catch (Exception ex)
param par = p;
string url = string.Empty;
string TimeLeft = string.Empty;
string writeLine = string.Empty;
DateTime date = DateTime.Now.AddDays(par.days);
string find = date.Month.ToString() + "/" + date.Day.ToString() + "/" + date.Year.ToString();
using (Ionic.Zip.ZipFile zip = Ionic.Zip.ZipFile.Read(""))
zip.ExtractAll("temp", Ionic.Zip.ExtractExistingFileAction.OverwriteSilently);

Error:- bad read of entry test.csv from compressed archive.

Although zip file have data If I extract manually I get the data but with this code I am getting error .
Can you please tell me where I did mistake or the solution.
Thanks and Regards!
Kuldeep Dwivedi

Jan 5, 2012 at 10:47 PM

I don't understand your code. It seems very wrong, or corrupted, or something.

Can you re-post, with the actual code you use?  (compilable code)

Mar 29, 2012 at 7:12 PM


hello I have the same problem

download the zip of a database, when is 1 file works fine, but when download 2 files, unpacks the first very well but the second sent me this exception my function is