Zip file created by archive/zip can't be opened on Windows machine

406 views
Skip to first unread message

Jimmy 99

unread,
Nov 10, 2017, 4:40:40 PM11/10/17
to golang-nuts
Is anyone familiar with the archive/zip package?
I am experiencing the following problem:
When I create the Zip file on Ubuntu the file can be extracted no problem.
When I try and extract the zip file on a windows machine I get an error saying the file cannot be created.

I have tried compiling the go app on the windows machine, and same problem - Windows file explorer cannot extract the zipped file.

Interestingly enough, 7zip on the windows machine can extract the zip file, but obviously I cannot ask the user community to install 7zip just to extract a zip file:(

Any help or pointers will be appreciated



Donovan

unread,
Nov 10, 2017, 7:25:45 PM11/10/17
to golang-nuts
its not totally clear the exact issue you're dealing with - a minimal example would go a long way.

If I had to guess, I would say your zip entries are using characters not supported by windows file systems. windows has more reserved characters than you might expect, and even reserved filenames you have to avoid like nul, ptr, etc. See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions

thebroke...@gmail.com

unread,
Nov 11, 2017, 7:27:54 PM11/11/17
to golang-nuts
If you can provide a minimal reproduction in Go code, then I can take a look at it. I fixed a number of zip issues for the upcoming Go1.10 release.

JT

Jimmy 99

unread,
Nov 12, 2017, 1:24:01 AM11/12/17
to golang-nuts
Dear Joe
Thanks for your gracious offer!
Please see the attached.
I have added the go code, a shortened data file , the pdf and zipped pdf output file
Please let me know if you need anything else
Regards
Jimmy
223451844.pdf
223451844.zip
MailMergeData.csv
templateit3.go

Klaus Post

unread,
Nov 12, 2017, 8:30:41 AM11/12/17
to golang-nuts
Hi!

Windows cannot extract password protected ZIP files without third party software. Sorry, but it a beef you need to take with Microsoft.



/Klaus
Reply all
Reply to author
Forward
0 new messages