Shlomi Fish <shlo...@shlomifish.org> writes:

> Hi lee,
>
> On Sat, 13 Feb 2016 14:17:54 +0100
> lee <l...@yagibdah.de> wrote:
>
>> Hi,
>> 
>> how can I make it so that my cgi program displays information on a web
>> page it sends to a user's web browser /and/ then makes the browser's
>> download dialog-box come up to let the user download a file?
>> 
>> It seems that making the web browser wanting to download a file is only
>> possible by sending appropriate page headers.  Since those have already
>> been sent to display the text on the web page, I can't seem to make the
>> browser download the file automatically.
>> 
>
> CGI (= the https://en.wikipedia.org/wiki/Common_Gateway_Interface  protocol
> which isn't Perl-specific) allows you send some extra headers to the server, 
> in
> the headers section before the first "\n\n". Which CGI library/framework are 
> you
> using? In this day and age Plack is recommended:
>
> http://perlhacks.com/2016/01/easy-psgi/

I'm using CGI, never heared of plack.  It allows me to write some header
information, with the documentation being entirely unclear about what
could be put there and how exactly to put it in.  And the header
information needs to be the first thing to print, so that's pretty
useless by the time the file the user should download has been created.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to