perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Sparks" <aspa...@cpd.harris.com>
Subject Re: Allowing the user to a download data
Date Wed, 01 Mar 2000 19:21:05 GMT
What you really want is the "Content-Disposition" header, something like:
Content-disposition: attachment; filename=$filename

Having said that, beware of buggy IE4 browsers that mess this up entirely...
as per MS KB article Q182315 at
http://support.microsoft.com/support/kb/articles/Q182/3/15.ASP?LNG=ENG&SA=AL
LKB&FR=0

If anyone has better ideas how to get content-disposition to work despite
MS, I'd love to hear it myself.  :-)
-Alan

-----Original Message-----
From: Joseph R. Junkin <jjunkin@datacrawler.com>
To: modperl@apache.org <modperl@apache.org>
Date: Wednesday, March 01, 2000 11:02 AM
Subject: Allowing the user to a download data


>In my application I allow the user to download a text file of database
>information. Right now, what I do is set the header 'type' in CGI.pm's
>header function to something like 'text/mydownloadtype'. I assume that
>because Netscape is unaware of any mime type of 'mydownloadtype' it
>brings up the 'save as' dialog box, which is what I want. Yet the name
>of the download file becomes the name of the script, which is not what I
>want. I would prefer to name the file, without actually having to create
>and store the file, i.e., I want the download to be dynamically created
>at the time then disappear.
>
>Q1) I want to do is force the browser (IE or Netscape) to start the
>textfile download process. Is there a standard or typical way that
>people do this either through CGI.pm's header call or directly through
>the modperl API?
>
>Q2) I want to force the name of the download file that appears inside
>the download box instead of the script name, even though the script is
>what is called as the file is created dynamically from it. In other
>words I don't want to generate and save the file then re-direct the user
>to it.
>
>Thanks,
>Joe Junkin
>jjunkin@datacrawler.com


Mime
View raw message