• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to zip a file in CI4

i have worked with CI3 which provided zip library but in CI4 there no such library. so i decided to go with php  zipArchieve() im having an issue with that on server. Can anyone suggest a good zip library or how to go about using zipArchieve in CI4. thanks

You can try this one.

Ne-Lexa - PhpZip
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

If your server has the right extension installed, PHP has it built in.

I'm trying to use php ZipArchive in my CI4 project. It is already enabled but it always give me this error: Class 'App\Controllers\ZipArchive' not found
Can you help me how to use ZipArchive? Thanks.

Prepend the namespace separator to ZipArchive. Like this

$zip = new \ZipArchive();

or if you do not want that. Try this instead,


namespace App\Controllers;

use ZipArchive;

$zip = new ZipArchive();

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.