How to password protect zip in php?

后端 未结 2 528
太阳男子
太阳男子 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

提交回复
热议问题