I’ve never used it, but this looks like it might do what you need.
Seems to take a list of file URLs and make a ZIP. But it might just be on the client side and prompt you to download, rather than running on the server and storing the .zip in your database.