springfresh
asked on
Add password on Zip via PHP
i tried this suggestion: https://www.experts-exchange.com/questions/22848474/Password-Protect-Zip-File-Using-PHP.html
But, it didn't worked. What should i try :/
But, it didn't worked. What should i try :/
ASKER
i am running on windows. I i am installed WAMP server on windows VISTA
zip must be in the PATH and the webserver must be able to write to the directory where WAMP is running.
Check your permissions and pathes.
Check your permissions and pathes.
ASKER
well, i am doing like that:
And it creates .zip file, but do not add password :/
And it creates .zip file, but do not add password :/
$zip = new ZipArchive();
$filename = $username.'-'.$date.'-'.$random.'.zip';
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
}
$zip->addFromString($date."-textfile.txt", "Works!\n");
echo system('zip -P bla '.$filename);
$zip->close();
ASKER
hm, aha i see now, that i need zip.exe in that dir. But where can i download free version. I tried from http://www.info-zip.org/Zip.html#Win32 . But i dont know which one should i download. I am using windows Vista
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks, worked!
which OS is the webserver running?