[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Content-Disposition to change type and action?
From:       Jay Jacobs <jay () lach ! net>
Date:       2001-05-30 5:40:29
[Download RAW message or body]

Ken's right and yeah, I wanted to stay away from Javascript and keep it
simple, it's not the doing of javascript that's bad, it's the redoing.

One thing that appears to work is setting the Content-Disposition header
value to "inline;filename=\"search.csv\"". (instead of "attachment").
IE5 seems to do the right thing with that, it pops up one box saying "what
would like to do with search.csv?".  Doing a redir might be a better
option then to trust IE4 and NS+ to do it correctly... not to mention
trusting IE6 to do anything like IE5.

Thanks for the help,
Jay

On Tue, 29 May 2001, Ken Williams wrote:

> stevep@marketview.co.nz (Steve Piner) wrote:
> >My suggestion is to use mod_rewrite to create a mapping so that the
> >actual file name doesn't matter. I have a rule in the Apache conf file:
> >
> >RewriteRule ^/reports/ /bin/report.pl [PT]
> >
> >So going to <http://www.mysite.com/reports/foo.csv?param1=val1> would be
> >the same as going to <http://www.mysite.com/bin/report.pl?param1=val1>
> >except if the page is to be downloaded, the browser will use the name
> >foo.csv.
>
> That doesn't solve the problem, though.  The type of file is chosen in a
> form, and the action of the form is already set by the time that form is
> loaded.  I assume Jay doesn't want to use Javascript to change the
> action dynamically.
>
> My own preference would be to post to some generic script which
> redirects to another URL with the desired filename extension and proper
> disposition headers.
>
>
>   -------------------                            -------------------
>   Ken Williams                             Last Bastion of Euclidity
>   ken@forum.swarthmore.edu                            The Math Forum
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic