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

前端 未结 6 1166
醉梦人生
醉梦人生 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:24

    One of the reasons for zip file is not created is due to missing check if you are adding file and not a directory.

    if (!$file->isDir())
    

    I found the solution here.

提交回复
热议问题