require_once "support/zip_stream_writer.php";
ZipStreamWriter::StartHTTPResponse("test.zip");
$zip = new ZipStreamWriter();
$zip->Init();
$lastmodified = mktime(0,1,0);
$lastaccessed = $lastmodified + 60;
$created = $lastmodified - 24 * 60 * 60;
$options = array(
"last_modified" => $lastmodified,
"64bit" => true,
"unix_attrs" => 0644,
"extra_fields" => array(),
"comment" => "Best file ever."
);
ZipStreamWriter::AppendNTFSExtraField($options["extra_fields"], $lastmodified, $lastaccessed, $created);
$uid = 1234;
$gid = 1234;
ZipStreamWriter::AppendUNIXExtraField($options["extra_fields"], $lastaccessed, $lastmodified, $uid, $gid);
$zip->OpenFile("Hello2.txt", $options, 0);
$zip->AppendFileData("Hello ");
if ($zip->BytesAvailable() > 65536) echo $zip->Read();
$zip->AppendFileData("there!");
echo $zip->Read();
$zip->CloseFile();
echo $zip->Read();
$zip->Finalize();
echo $zip->Read();
And running WinZip to try opening it.
I am looking for advice on how to track down this problem. I try to generate the archive with and without 64bit with same result.
This problem doesn't exist with AddFileFromString method.
Thanks for your help looking into this.