Extracting zip64 files with archive/zip

Is there something special I need to do in order to extract zip64 files using the archive/zip package? The docs just mention the 64-bit size fields but code to extract a zip file doesn’t need to access that. I’m asking mostly in reference to archiver/zip.go, a project of mine.

Trying to extract a zip64 file with that code yields:

zip: not a valid zip file

Anyway, it appears to be a valid zip64 file. Anyone know what I might be missing?

Could you show your code ? mainly the filename struct and the call to the library ? Thanks.

I linked to it in my post. Sorry if that wasn’t clear. I am just wondering if there is some std lib incompatibility with zip64 files or if there was something I was missing in how I was doing it.

Hmmm, let me do this download again and run a SHA to make sure it is in fact a totally valid zip file, maybe I just got lucky with that other tool.

I thought you had isolated a part of your code. At first glance, I see two r.Close from the func you point to and immediately afterwards in the unzip… If not done, you can check the examples of the package https://golang.org/pkg/archive/zip/#example_Reader

Otherwise, can you detail your input ? Can you also indicate if your ZIP files are 32/64 bit in line with documentation (see Overview) ?

Aha, you know what, the download was corrupted. Silly Chrome. (Stupid Microsoft website didn’t have any checksum to compare!)

It works with zip64, false alarm. :smile: Thank you!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.