No error when creating zip, but it doesn't get created

前端 未结 6 1192
醉梦人生
醉梦人生 2021-02-18 15:38

I wrote this code to create a ZIP file and to save it. But somehow it just doesn\'t show any error, but it doesn\'t create a ZIP file either. Here\'s the code:

$         


        
6条回答
  •  执念已碎
    2021-02-18 16:15

    There are 2 cases when zip doesn't generate the error.

    1. Make sure every file you are adding to the zip is valid. Even if one file is not available when
      zip->close is called then the archive will fail and your zip file won't be created.
    2. If your folder doesn't have write permissions zip will not report the error. It will finish but nothing will be created.

提交回复
热议问题