Files compressed using this function on Linux won't be decompressed using Windows.
There seems to be some incompatibility with Windows built-in decompressor.
There's an alternative library that works better here:
romke at romke dot nl ¶4 years ago
On windows is the "EM_AES_256" by default not supported, but you can use winrar, winzip or 7zip.
At first we had a password of 128 chars (this was to long) and all extract applications give an error that the password was incorrect.
The next time we did use a password of 52 chars., this time i did work!
Anonymous ¶
1 year ago
When using setEncryptionName, the first parameter is equal to the entry name of the file you added.
In case you set an explicit entry name with the second parameters of the addFile method, then you need to use that entry name.
Using the first parameter of addFile will only work in case the second parameter is not used.
This works :
$zip->addFile('test.txt', 'my_awesome_textfile.txt');
$zip->setEncryptionName('my_awesome_textfile.txt', ZipArchive::EM_AES_256);
This does not work and will generate an archive without any encryption :
$zip->addFile('test.txt', 'my_awesome_textfile.txt');
$zip->setEncryptionName('text.txt', ZipArchive::EM_AES_256);