Re: content-disposition not recognized

[prev] [thread] [next] [Date index for 2004/11/19]

From: Stas Bekman
Subject: Re: content-disposition not recognized
Date: 20:27 on 19 Nov 2004
Micah Johnson wrote:
> I am having difficulty sending an XML file to the
> browser using the Content-Disposition: attachment
> header.
> 
> I am running mod_perl/1.99_13 and trying to use an
> existing cgi script which returns data in various
> forms.  One is an XML file.  The script is found in a
> directory setup like this:
> 
> <Location /cgi-perl>
>    SetHandler perl-script
>    PerlResponseHandler ModPerl::PerlRun
>    PerlOptions +ParseHeaders
>    Options ExecCGI
> </Location>
> 
> and the script prints headers like this:
> 
>     print "Content-type: text/plain\n";
>     print "Content-Disposition: attachment;
> filename=results.xml\n\n";
> 
> The resulting file reports a server error 500,
> premature end of script headers and the
> content-disposition line is displayed, so it looks
> like it is not being treated as a header.

Try to add:

   local $| = 0;

before sending headers, or send the header at once:

print q[Content-type: text/plain\n] .
q[Content-Disposition: attachment;filename=results.xml\n\n].

> Any suggestions on how to fix this?

Unrelated, better upgrade to the latest 1.99_17, to avoid problems that 
were already fixed.


        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

(message missing)

content-disposition not recognized
Micah Johnson 14:49 on 19 Nov 2004

Re: content-disposition not recognized
Stas Bekman 20:27 on 19 Nov 2004

Re: content-disposition not recognized
Micah Johnson 22:25 on 19 Nov 2004

Re: content-disposition not recognized
Stas Bekman 22:29 on 19 Nov 2004

Re: content-disposition not recognized
Stas Bekman 22:31 on 19 Nov 2004

Re: content-disposition not recognized
Micah Johnson 22:35 on 19 Nov 2004

Re: content-disposition not recognized
Stas Bekman 22:38 on 19 Nov 2004

Re: content-disposition not recognized
Stas Bekman 00:08 on 20 Nov 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52