serving multiple files as a zip

alex alex at state51.co.uk
Fri May 5 15:41:29 UTC 2006


It's nice to allow web users to download several files in one go.  For
example choose 5 tracks they like from an album and download a zip.

I was wondering if this could be sensible

1/ User clicks on a link
2/ perlbal gets the request, proxies it
3/ apache gets the request, maps the link to five files, returns a
reproxy header giving the relevant file locations
4/ perlbal serves the files back to the user, combined into an
uncompressed application/zip file

Step four wouldn't require any extra memory or disk usage, latency or
cpu.  Zip files can be streamed as they're constructed.  It's possible
to predict the size of zip files and its parts in advance by doing a
HEAD request for each part and adding on header size, so byte range
support can work.

So, a good idea?  I can share some potentially useful code if so, I've
got this kind of zip file streaming working in Perl already with a
subclass of Archive::Zip::Member.

alex




More information about the perlbal mailing list