in reply to Re: downloading file with CGI
in thread downloading file with CGI

well,if I read from file and print it to STDOUT (as suggested) then it prints to the browser itself and dont prompt for download.

Replies are listed 'Best First'.
Re^3: downloading file with CGI
by almut (Canon) on Dec 02, 2009 at 20:05 UTC

    You have to do both, i.e. use the -attachment header and print the content.  The header tells the browser to prompt with "Save [as...]", using the suggested filename as default.