Hi guys,
I’m currently trying to figure out the best way to make this work, any input/advice would be massively appreciated.
What I’m trying to achieve: A dynamically generated PDF file (contents from a channel entry) A dynamically generated .doc file (same contents as above) A dynamically generated .zip archive of those 2 files + some other static files
I’ve managed to get the first two working, the PDF using the great EEI_TCPDF plugin (which is a wrapper for TCPDF) and a template which basically is create/pdf/{entry_title}. Clicking the link to this page serves the PDF and gives you the download box.
For the .doc I’ve got another template create/doc/{entry_title} which serves up the channel contents and has some PHP headers to force it to act like it’s a word document. Again, clicking the link serves the doc.
As for the zipping, I’ve been using Max Lazar’s addon MX Zip to attempt to generate the zip, (which in turns uses the built in CodeIgniter zip library), but when I feed it those 2 ‘create’ URLs it creates an empty archive.
Without creating the pdf/doc temporarily on the server, is there a way I can trick the zip feature (with or without MX Zip) to ‘properly’ serve the 2 dynamic files before grabbing them (I assume from memory) and adding them to a zip? Or is this impossible? Would using something like curl help, to generate the correct request to make the files generate?
I’m a bit out of my depth here, my normal role is front-end but I’m trying to get stuck in with something that is really giving me trouble here.
Thanks in advance,
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.