summaryrefslogtreecommitdiff
path: root/web/src/cgi.tcl-1.10/example/download.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/download.cgi
downloadalpine-094ca96844842928810f14844413109fc6cdd890.tar.xz
Initial Alpine Version
Diffstat (limited to 'web/src/cgi.tcl-1.10/example/download.cgi')
-rwxr-xr-xweb/src/cgi.tcl-1.10/example/download.cgi36
1 files changed, 36 insertions, 0 deletions
diff --git a/web/src/cgi.tcl-1.10/example/download.cgi b/web/src/cgi.tcl-1.10/example/download.cgi
new file mode 100755
index 00000000..c82cb3f5
--- /dev/null
+++ b/web/src/cgi.tcl-1.10/example/download.cgi
@@ -0,0 +1,36 @@
+#!/depot/path/tclsh
+
+package require cgi
+
+set msg "Very funny, Scotty. Now beam down my clothes."
+set filename "scotty.msg"
+
+cgi_eval {
+ source example.tcl
+
+ cgi_input
+
+ if {[catch {cgi_import style}]} {
+ cgi_title "download example"
+ body {
+ cgi_suffix ""
+ form download.cgi/$filename {
+ puts "This example demonstrates how to force files to be
+ downloaded into a separate file via the popup file browser."
+ br
+ puts "Download data"
+ submit_button "style=in window"
+ submit_button "style=in file using popup file browser"
+ }
+ }
+ } else {
+ if {[regexp "in window" $style]} {
+ title "Display data in browser window"
+ } else {
+ cgi_http_head {
+ content_type application/x-download
+ }
+ }
+ puts $msg
+ }
+}