Compress File or Folder.
App::Module('Zip')
->setFileName(ZIP File Path)
->Compress(Zip Location);
Parameter |
Type |
Description |
---|---|---|
Zip File Path |
Mandatory |
Destination file path of zip |
Zip Location |
Mandatory |
Source folder to Zip |
See bellow examples:
// Compress file
App::Module('Zip')
->setFileName(App::Config()->baseDir("/uploads/test.zip"))
->Compress(App::Config()->baseDir("/uploads/test"));