\n\nrequire (\"incl\/pclzip.lib.php\");\n$zipfile = new PclZip('zipfile.zip');\n$v_list = $zipfile->create('incl\/pclzip.lib.php');\nif ($v_list == 0) {\ndie (\"Error: \" . $zipfile->errorInfo(true));\n}\nheader(\"Content-type: application\/octet-stream\");\nheader(\"Content-disposition: attachment; filename=zipfile.zip\");\nreadfile(\"zipfile.zip\");\n<\/pre>\n<\/blockquote>\nThis one works with every unzip tool I’ve tried, Windows, OS X, command line unzip etc. It also has decent error reporting etc.<\/p>\n","protected":false},"excerpt":{"rendered":"
I did some more testing with the code I posted yesterday and found it isn’t 100% compatible with some unzip programs. Works with unix unzip, Mac OS X default tool, WinZip, WinRAR but annoyingly not with the default XP zip folder thing. The problem seem to be 4 rogue bytes that gets inserted somewhere. So […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","footnotes":""},"categories":[7],"tags":[121,42],"_links":{"self":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/306"}],"collection":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":1,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":668,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/306\/revisions\/668"}],"wp:attachment":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/media?parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/categories?post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/tags?post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}