View more context

 

Rathai

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

Bjorn Bojumble

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?

Firesphere

I always use ZipStream for this, download and add files on the fly to a zip and stream it directly to the user

Bjorn Bojumble

This is being done via a buildtask. Do I need to use grantFile()? Would I need to publish these files?

thezenmonkey

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
Rathai in #cms4 2019-05-05 00:15:52 (edited) (deleted)

https://silverstripe-users.slack.com/archives/C36U3BDHN/p1556970101090800 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

https://silverstripe-users.slack.com/archives/C36U3BDHN/p1556916096089100 Thanks. This is sorted out.

Show 1 attachment(s)
Rathai

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: