I ran into this problem to. There's a simple workaround. Use the perl excel library to write the file to a temp directory that serves static content. Then use $m->redirect to that url.
Mark On Wed, 7 Jun 2006, John Peacock wrote: > From: John Peacock <[EMAIL PROTECTED]> > To: [email protected] > Date: Wed, 07 Jun 2006 12:32:35 -0400 > Subject: [Mason] H::M::ApacheHandler, Modperl2.x, and content_type > > I have an internal app which uses H::M::ApacheHandler, mod_perl-2.x, and > a dhandler to serve up online reports for our publishers. The old > version was a monolithic Perl script and the new one (put into > production early due to hardware failure on the old box) works almost > exactly the same with one exception. When someone goes to download an > Excel spreadsheet, the server is sending the following headers: > > > HTTP/1.1 200 OK > > Date: Wed, 07 Jun 2006 15:57:37 GMT > > Server: Apache/2.0.49 (Linux/SuSE) mod_ssl/2.0.49 OpenSSL/0.9.7d > > mod_apreq2-20051231/2.5.7 mod_perl/2.0.1 Perl/v5.8.3 > > Set-Cookie: Reports=ec9cf03395cc7ef2cc7d550663548bed; path=; expires=Wed, > > 07-Jun-2006 16:27:38 GMT > > Content-Disposition: attachment; filename=DAILY_INVGRN-2006-06-06.XLS > > Keep-Alive: timeout=15, max=100 > > Connection: Keep-Alive > > Transfer-Encoding: chunked > > Content-Type: application/octet-stream > > even though I am setting the Content-Type to 'application/vnd.ms-excel' > in the appropriate module. I tried setting it both using > > $r->content_type('application/vnd.ms-excel') > > as well as > > $r->headers_out->{'Content-Type'} = 'application/vnd.ms-excel' > > but nothing changes. This is causing problems with certain browsers > which are too stupid to check the MIME type as well as the file > extension to determine application mapping. > > I *am* setting a DefaultTupe in the conf file (but that is 'text/html' > so I am mystified by my inability to alter this setting. Do I need to > switch to using HTML::Mason::CGIHandler? Should I be setting an AddType > in mod_mime-defaults? > > TIA > > John > > -- > John Peacock > Director of Information Research and Technology > Rowman & Littlefield Publishing Group > 4501 Forbes Boulevard > Suite H > Lanham, MD 20706 > 301-459-3366 x.5010 > fax 301-429-5748 > > > _______________________________________________ > Mason-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mason-users > _______________________________________________ Mason-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mason-users

