update.
[elisp/album.git] / img.cgi
1 #!/bin/sh
2
3 relfile=`echo "$QUERY_STRING"|cut -d'&' -f1`
4 size=`echo "$QUERY_STRING"|cut -d'&' -f2|cut -d'=' -f2`
5
6 file=/home/tomo/pub/pages/`dirname "$relfile"`/"$size"/`basename "$relfile"`
7
8 if [ -f $file ]
9 then
10     echo "Content-Type: `file -b --mime $file`"
11     echo "Content-Length: `ls -l $file | cut -d' ' -f6`"
12     echo
13     cat "$file"
14 #    echo Content-Type: text/plain
15 #    echo
16 #    echo "$file"
17 else
18   xemacs -q -batch -l www-page.elc -f www-page-batch-get "$QUERY_STRING"
19 #  xemacs -q -batch -l www-img.elc -f www-page-batch-get "$QUERY_STRING"
20 fi