View more context



You should be able t create it in your public directory and delete after. Though honestly I haven’t had to do this in an SS4 project before.

Bjorn Bojumble

I can create the zip file no problem. Its adding the files to the zip

Rathai in #cms4 2019-05-05 00:15:52 (edited) (deleted) Thanks. This is sorted out.

Show 1 attachment(s)
James Ayers

Hi All, trying to generate a zip file on the fly of a bunch of assets files. Adding to a zip needs a path to the file. But I dont seem to be able to get that? What’s the trick I need?

Hide attachment content
Rathai Thanks. This is sorted out.

Show 1 attachment(s)

Can anyone guide on this? I enabled template plugin in tinymce... please let me know how to link my templates...

Hide attachment content
Bjorn Bojumble

@Firesphere yeah ZipArchive does the trick too. Its more about getting the system path to the file Im adding. Ended up doing this:

Bjorn Bojumble
  1. if ($zip->open($filePath, ZipArchive::CREATE) === true) {
  2. foreach ($files as $file) {
  4. if ($file && $file->File->exists()) {
  5. $file->publishFile();
  6. $filePath = PUBLIC_PATH . '/' . $file->File->getSourceURL(true);
  7. $zip->addFile($filePath, $file->Name);
  8. }
  9. }
  10. }

Ow, yah, either published or granted. I've run in to that too 😕