On Mon, 24 Feb 2014, Michael Moore wrote:

> On Mon, Feb 24, 2014 at 2:42 PM, Mike Miller <mbmiller+l at gmail.com> wrote:
>
>> On Mon, 24 Feb 2014, Michael Moore wrote:
>>
>>> 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.

Thanks again, Michael.

You've convinced me that the temp file approach is a good idea.  How do 
you do that?  I can do something like this to make the file...

#!/bin/bash

DIR=$1
PATH=/home/user/www/photos

cd $PATH

zip -r "$DIR".zip "$DIR" &>/dev/null


...but then how do I tell Apache to send the file?  Can I do that within 
the script?  I could do something like this:

echo "Content-type: application/octet-stream"
echo "Content-Disposition: attachment; filename=$DIR.zip"
echo  ""

cat $PATH/"$DIR".zip


But if single quotes are required on the filename, that won't work. 
Also, how do I send the file size?

Thanks!

Mike