Depending on how many files you're planning on handling per request you can either keep them all in memory or temporarily store them on the disk or in a database.
Once you have all of the files, you can then zip them up using any number of zip libs that are out there.