I'm trying to zip a large number of pdf files (stored as BLOBs in the DB) and then return the zip as an attachment to the user.
What's the best way to do this without running into memory issues?
Another note: I actually need to merge some PDFs prior to adding them to the ZipOutputStream. Therefore, a couple PDFs will need to be stored in memory at a time.
I assume it would be best to then store them as temporary files on the server before zipping them all?