From 0785dcfeced2195d783d7a1b552482b5a19c0ff0 Mon Sep 17 00:00:00 2001 From: tomo Date: Fri, 22 Sep 2006 04:19:53 +0000 Subject: [PATCH] New file. --- img.cgi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 img.cgi diff --git a/img.cgi b/img.cgi new file mode 100755 index 0000000..7b23a89 --- /dev/null +++ b/img.cgi @@ -0,0 +1,20 @@ +#!/bin/sh + +relfile=`echo "$QUERY_STRING"|cut -d'&' -f1` +size=`echo "$QUERY_STRING"|cut -d'&' -f2|cut -d'=' -f2` + +file=/home/tomo/pub/pages/`dirname "$relfile"`/"$size"/`basename "$relfile"` + +if [ -f $file ] +then + echo "Content-Type: `file -b --mime $file`" + echo "Content-Length: `ls -l $file | cut -d' ' -f6`" + echo + cat "$file" +# echo Content-Type: text/plain +# echo +# echo "$file" +else + xemacs -q -batch -l www-page.elc -f www-page-batch-get "$QUERY_STRING" +# xemacs -q -batch -l www-img.elc -f www-page-batch-get "$QUERY_STRING" +fi -- 1.7.10.4