summaryrefslogtreecommitdiff
path: root/web/src/cgi.tcl-1.10/example/image.cgi
diff options
context:
space:
mode:
authorEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
committerEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
commit094ca96844842928810f14844413109fc6cdd890 (patch)
treee60efbb980f38ba9308ccb4fb2b77b87bbc115f3 /web/src/cgi.tcl-1.10/example/image.cgi
downloadalpine-094ca96844842928810f14844413109fc6cdd890.tar.xz
Initial Alpine Version
Diffstat (limited to 'web/src/cgi.tcl-1.10/example/image.cgi')
-rwxr-xr-xweb/src/cgi.tcl-1.10/example/image.cgi29
1 files changed, 29 insertions, 0 deletions
diff --git a/web/src/cgi.tcl-1.10/example/image.cgi b/web/src/cgi.tcl-1.10/example/image.cgi
new file mode 100755
index 00000000..e1321523
--- /dev/null
+++ b/web/src/cgi.tcl-1.10/example/image.cgi
@@ -0,0 +1,29 @@
+#!/depot/path/tclsh
+# See description below.
+
+package require cgi
+
+cgi_eval {
+ source example.tcl
+ cgi_input
+
+ describe_in_frame "raw image" "This CGI script generates a raw
+ image. The script could be much more complicated - the point is
+ merely to show the framework. (The picture is of the US National
+ Prototype Kilogram. It is made of 90% platinum, 10% iridium. It
+ was assigned to the US in 1889 and is periodically recertified and
+ traceable to [italic "The Kilogram"] held at
+ [url "Bureau International des Poids et Mesures" http://www.bipm.fr" $TOP]
+ in France.)"
+
+ # ignore the junk above this line - the crucial stuff is below
+
+ cgi_content_type "image/jpeg"
+
+ set fh [open $DATADIR/kg.jpg r]
+ fconfigure stdout -translation binary
+ fconfigure $fh -translation binary
+ fcopy $fh stdout
+ close $fh
+}
+