> > This reminds me to ask about something I've been thinking of doing with >> photos on web pages and Apache cgi-bin. I have photos on web pages with >> this kind of layout: >> > > http://genetsim.org/Seoul/20100605_Seoul/ > > I wrote scripts that compile pages from a few basic elements -- a > collection of image files in a directory, one file with captions, another > file with intro info, another with title. > > What I'd like to do is add a link that allows the user to click on it and > download the whole works in a .zip file. I think the zip file can be > written on the fly instead of storing a bunch of .zip files on the web > server, doubling the space used by photos. > > Have any of you done something like this using cgi-bin? It seems doable > but it has been awhile since I've done anything like this. I like to make a temp file and send that so that I can indicate the file size to the user. If you don't indicate a file size the progress bar in their download manager just goes back and forth. However, if you want to just send a zip file which is created on the fly, you can do something as simple as this: I save and tried this as a CGI script and it worked. The '-' tells zip to send the zip file to stdout, which in a CGI scenario means to send it to the browser. #!/bin/bash echo "Content-type: application/octet-stream" echo "Content-Disposition: attachment; filename='mydownload.zip'" echo "" zip -0 - /var/www/html/ziptest/* -- Michael Moore -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20140224/66f95f56/attachment.html>