Re: content-disposition not recognized

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

From: Stas Bekman
Subject: Re: content-disposition not recognized
Date: 22:38 on 19 Nov 2004
Micah Johnson wrote:
> --- Stas Bekman <stas@xxxxxx.xxx> wrote:
> 
> 
>>Micah Johnson wrote:
>>[...]
>>
>>>>print q[Content-type: text/plain\n] .
>>>>q[Content-Disposition:
>>>>attachment;filename=results.xml\n\n].
>>>
>>>
>>>Thanks!
>>>The local $| = 0 trick works.  Would you mind
>>>explaining what is happening?  FYI, putting the
>>>headers on one print doesn't seem to fix it.
>>
>>Micah, please describe the outcome with the second
>>approach. Do you still 
>>get 500 or just the headers are wrong? should there
>>be a white space 
>>before 'filename='?
> 
> 
> I inherited this CGI and just tried to make it work
> as-is.  If I put it all in one line and remove all the
> whitespace, it works without the buffering trick.

My apologies, you can't use q[] with \n, it must be qq[]. So this should work:

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

or even more readable:

print <<END;
Content-type: text/plain
Content-Disposition: attachment;filename=results.xml

END

        -- 
        __________________________________________________________________
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