|
Post by Al on Feb 26, 2006 11:03:20 GMT -5
After using ZipFromStream I've found that the resulting ZIP files are not fully compatible.
WinZip gives the following error message if you try to delete an item in the zip:
Action: Delete Warning: the number of entries (6) in the central directory does not match the number of entries found (3) Error: Unsupported or invalid Zip file structure (C:\Work\Test VCLZip\test.zip)
Code to create a simple test ZIP file is as follows:
procedure TFormVCLTest.ButtonZipItClick(Sender: TObject); var tempMemoryStream: TMemoryStream; tempStringList: TStringList; begin tempMemoryStream := TMemoryStream.Create; tempStringList := TStringList.Create; tempStringList.Add('LINE 1'); tempStringList.Add('Line 2'); tempStringList.Add('Line 3'); VCLZip.ZipName := 'test.zip'; tempStringList.SaveToStream(tempMemoryStream); tempMemoryStream.Position := 0; VCLZip.ZipFromStream(tempMemoryStream,'File1.txt'); tempMemoryStream.Position := 0; VCLZip.ZipFromStream(tempMemoryStream,'File2.txt'); tempMemoryStream.Position := 0; VCLZip.ZipFromStream(tempMemoryStream,'File3.txt'); tempMemoryStream.Free; tempStringList.Free; end;
Any ideas what may be causing this?
Al
|
|
|
Post by Kevin on Feb 27, 2006 8:02:22 GMT -5
Off hand I don't know why this would be, I'll have to try to recreate the problem here. I'll test your code and see what I come up with. I haven't seen this reported in the past, but it's possible that VCLZip is duplicating the central directory entries for some reason. Can you send me your zip file that is causing this error, it might save some time? Send it to Support@vclzip.net. Also, what version of WinZip are you using? Thanks, Kevin
|
|