New file.
authortomo <tomo>
Fri, 22 Sep 2006 04:19:53 +0000 (04:19 +0000)
committertomo <tomo>
Fri, 22 Sep 2006 04:19:53 +0000 (04:19 +0000)
img.cgi [new file with mode: 0755]

diff --git a/img.cgi b/img.cgi
new file mode 100755 (executable)
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