How to password protect zip in php?

后端 未结 2 524
太阳男子
太阳男子 2020-12-19 15:36

I am able to create zip file using ziparchive lib in php. Is there any way I can specify a password for the zip files that I create? Is there any other custom library that c

相关标签:
2条回答
  • 2020-12-19 16:06

    use this:

    system('zip -P password zipfile.zip file.extension');
    

    pass is the password, and file.extension will be zipped into zipfile.zip.

    works on Windows and Linux

    0 讨论(0)
  • 2020-12-19 16:08
    shell_exec('zip -qjP <password> <archive> <file1> <file2> ... <file_n>');
    
    0 讨论(0)
提交回复
热议问题