in reply to Re: Perl CGI : Output to HTML and download a file
in thread Perl CGI : Output to HTML and download a file

Thank you Corion. I tried the type parameter and it seems to work well to display the html content. however the print CGI->redirect after the display part of code doesnt work properly . "Status: 302 Found Location:<exceldownloadfile-script>" is getting printed.
  • Comment on Re^2: Perl CGI : Output to HTML and download a file

Replies are listed 'Best First'.
Re^3: Perl CGI : Output to HTML and download a file
by Corion (Patriarch) on Aug 12, 2014 at 12:04 UTC

    I think now is a good moment to familiarize yourself with the different types of redirect, and how HTTP and HTML interact in general.

    I recommend looking at the usual ways that the download sites do this. The two most common ways are a <meta http-equiv="refresh; URL=..."> or using Javascript to fetch the download URL.