Problems with Zip.AddFile

Aug 17, 2013 at 11:29 PM
Edited Aug 18, 2013 at 12:12 AM
Hi,

I'm using AddFile to add a bunch of files to a new archive which I then save to a stream, but this never seems to work!
I can use AddEntry to add an entry from content, but with AddFile the zip is always invalid.

Strangely, if I read the file contents into a byte array and add them using AddEntry, I have the same problem, but AddEntry with a text string works fine.

I'd be grateful for any suggestions!

Note: this all works fine if I save it to a file, but not if I save to a stream!

UPDATE
This seems to be an output size issue because if I initialize the stream to exactly the right size, it works.
Is there a way to get the total archive size without writing it to disk?
Oct 1, 2013 at 2:48 PM
Is this possibly related to this one?