Skip to main content
Known Participant
June 24, 2008
Question

cfzip tag to read files without unzipping

  • June 24, 2008
  • 2 replies
  • 988 views
I'm getting an error when trying to use the read action on a zip file. I can use the list action to get a list of the file names within the zip file. But, then I can't read a file using the read action. Anyone see what I'm doing wrong?

Here's the error message:
Exception encountered while reading the file D:\site\testSite\test\test.zip.
Ensure that the file is a valid zip file and it is accessible. Cause : java.util.zip.ZipException: ZIP_Read: specified offset out of range

And, here's the code:
    This topic has been closed for replies.

    2 replies

    jqcfAuthor
    Known Participant
    June 26, 2008
    Something that I've recently learned is that the zip files may be damaged and cfzip doesn't appear to be smart enough to know how to deal with damaged zip files. The 7zip program can open and extract this zip file, but cfzip cannot. Any ideas someone might have to deal with these damaged files within Coldfusion would be greatly appreciated.
    Inspiring
    June 25, 2008
    are you sure you are trying to read a text file from your zip? if it is
    a binary file, you need to use action="readBinary"...

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    jqcfAuthor
    Known Participant
    June 25, 2008
    Yes, and just to make sure, I tried action="readBinary". I get the same error message.