perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bishop <t...@activespace.com>
Subject Re: Allowing the user to a download data
Date Wed, 01 Mar 2000 19:24:21 GMT

We just had the same problem.  Use the Content-Disposition header:

'Content-Disposition'   => "attachment;filename=$filename"

See:
  http://www.faqs.org/rfcs/rfc2183.html

It seems that late model (exact versions unknown - anyone? ) support this
header.

-Tim

On Wed, 1 Mar 2000, Joseph R. Junkin wrote:

> 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