We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Zipping dynamically streamed files

Development and Programming

Robzor's avatar
Robzor
86 posts
14 years ago
Robzor's avatar Robzor

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,

       
Robzor's avatar
Robzor
86 posts
14 years ago
Robzor's avatar Robzor

For anyone who’s interested, ended up just temporarily creating the files on the disk and setting a cron job to clear the folder daily.

Oh well!

Thanks,

Rob

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.