CodeIgniter Forums
Zipped PDFs yields corrupt zip file - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Zipped PDFs yields corrupt zip file (/thread-32992.html)

Zipped PDFs yields corrupt zip file - El Forum - 08-11-2010

Using: dompdf (, zip encoding class
Version: 1.7.2

The workflow goes as follows:
After a message is created and the members that will be given the message selected, the application creates a pdf file of each message for each member, zip these pdf files and then stream to user.

When the pdf files are just purely text + the [x] image put in by dompdf for images not found, the downloaded archive can be opened. When I got the images to render on the pdf files, the archiving started yielding corrupt zip files. I verified that the pdf files with images can be opened by opening it from the source folder.

Could this be a bug in the Zip Encoding class or just in zip files in general?

Trying to open it from Ubuntu using 7z and unzip, respectively:
[email protected]:/tmp$ 7z e

7-Zip 9.04 beta  Copyright (c) 1999-2009 Igor Pavlov  2009-05-30
p7zip Version 9.04 (locale=C,Utf16=off,HugeFiles=on,2 CPUs)

Processing archive:

Error: Can not open file as archive

[email protected]:/tmp$ unzip

  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of or, and cannot find, period.