[REBOL] [CGI] Re: downloading files with CGI
From: SunandaDH::aol::com at: 20-Nov-2003 2:17
> How do I use REBOL to write a CGI script
> that builds a page with a download link?
Simply version: you just need a href to the file that you want downloaded.
Take a look at the source of:
The "click here to download the alpha version" is simply a link to the file
that will be downloaded.
This may not be what you want, and it can cause problems with browsers have
trouble with downloading files that contain HTML. (That may be because the
server or browser is sending/assuming a content-type: text/html).
The Script Library also uses another method (I've been experimenting with
various things, and the experiments are not at an end) to download a file that
may not exist until you click the link. Take a look at:
That has links to " Download documentation as: [HTML] or [editable]". Those
files probably don't exist until you click the link. The link is to a program.
That program creates the file and then sends a HTTP redirect to point your
browser at the file it has created:
print join "Location: "
print "^/" ;; newline to end HTTP headers