[REBOL] Re: Sending a PDF to Browser
From: andrew:martin:colenso:school at: 15-Sep-2003 12:11
DJ wrote:
> Because the browser asks to 'open, 'save, but saves with the program
name.
> Is there any way to save with a name that I give ?
If you're not using MS Internet Explorer (MSIE) browsers, you can
specify a name in the headers, using the Content-Disposition header,
like this:
print rejoin [
"Content-Disposition: attachment; "
{filename="} form last split-path File #"^""
]
But if you're using MSIE, you've got a problem as MS doesn't understand
Content-Disposition
as per specifications. Instead, MSIE uses the
first file name in the URL to name the file! There's some work arounds
that can be done to overcome this, such as renaming one's CGI to be the
same as a directory, (but I haven't managed to make this work yet).
> [Sun Sep 14 20:27:56 2003] [error] [client 127.0.0.1] Premature end of
> script headers: f:/apache/cgi-bin/browser.r
Maybe no blank line? Or perhaps too many?
Andrew J Martin
Attendance Officer &
Information Systems Trouble Shooter
Colenso High School
Arnold Street, Napier.
Tel: 64-6-8310180 ext 826
Fax: 64-6-8336759
http://colenso.net/scripts/Wiki.r?AJM
http://www.colenso.school.nz/
DISCLAIMER: Colenso High School and its Board of Trustees is not responsible (or legally
liable) for materials distributed to or acquired from user e-mail accounts. You can report
any
misuse of an e-mail account to our ICT Manager and the complaint will be investigated.
(Misuse can come in many forms, but can be viewed as any material sent/received that
indicate or suggest pornography, unethical or illegal solicitation, racism, sexism, inappropriate
language and/or other issues described in our Acceptable Use Policy.)
All outgoing messages are certified virus-free by McAfee GroupShield Exchange 5.10.285.0
Phone: +64 6 843 5095 or Fax: +64 6 833 6759 or E-mail: [postmaster--colenso--school--nz]