Warning.. I'm really new at perl so excuse me if this is a easy question....
I'm trying to force a HTML file to download instead of displaying after clicking a link with in a perl file...
I have a link in the perl file that will say Download. When the link is clicked the save file dialog box should appear in the users browser and allow the user to save the HTML file.
I have this working from a standalone file but I would like to run it as a subroutine of an existing script.
Here is the problem as I see it. In order to force the download in the stand alone file I send these headers
print "Content-type: application/unknown\n\n";
print "Content-Disposition: inline; filename= $filename \n";
When I try to run it as a subroutine in the original script the headers are already sent (I need to send them to display the menu) so these headers just display as text on the screen.
Sorry for my newbie-is-ness