> I think you're looking for the 'Content-disposition' header here. By
> setting it to inline, it suggests to the browser to view it inline,
> instead of prompting to save it.
I've had success using the following header:
Content-Type: application/octetstream\n
Content-Disposition: attachment; filename=$filename\n\n
> The problem with the above CGI::App behaviour not being documented is that
> it can dissapear. I really feel that there are cases where it's necessary
> to send stuff to the browser from within the run_mode, and I feel yours is
> a valid one. I hope Jesse will leave the functionality in there, or
> perhaps even make it easier by making an accessor method for it :-)
You should be able to use the argument of 'none' to the CGIApp header_type()
method.
e.g. $self->header_type('none');
This functionality was added to CGIApp v3.1 on June 2nd. Something along the
lines of the following should do the trick:
-------------------
my $filename= 'the_pdf_file.pdf";
my $output = get_pdf_contents();
my $header= "Content-Type: application/octetstream\n";
$header .= "Content-Disposition: attachment; filename=$filename\n\n";
$self->header_type('none');
return $header.$output;
---------------
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.