Closing a Blank Leftover Window
Hello everyone,
I'd like to start out by saying that I'm brand new to Perl, HTML and all the rest. I have a general understanding of C++ and that's about it. So before I continue, please bear in mind I could be wrong with my "code speak" lol. On to the fun part...
I've been asked to see why this code is acting strange (I'm determined). The script that runs opens linked .pdf's from a home page. The bug was that if a .pdf was opened and you clicked the "Email" button inside Acrobat, Acrobat would attach the "read in line by line" .pdf as News.pl instead of "News-(article number).pdf". Here's the old statement:
******
print $q->header(-Disposition => "inline; name=News-$news_id.".pdf", -Type => 'application/pdf');
while (<FILE>) {
print $_;
}
## $q being my CGI object
******
I commented the code above out and put in the following, which works for the most part but there's a slight issue that comes with it:
******
print "Content-Disposition: attachment; filename=News-$news_id.pdf";
print "Content-Type: text/html\n\n";
******
This code prompts the user with the Open, Save, Cancel or More Info box. If the user chooses Open, the window closes and the file is opened and everything works great. If the user chooses Save, the file gets saved, but there's a blank browser window that sticks around afterward. I'm trying to find a solution on how to close that left over window.
Any suggestions? I'll be watching this post like a hawk for awhile, so feel free to request more information.
Thanks oh so much,
Heff
|