I am running a perl cgi script trying to open a "save-as" dialogue box to let the user download and save a particular file on their computer. Currently my code looks something like this:
print "Content-Disposition: attachment; filename=$temp\n\n";
print "Content-Type: application/x-download\n";
print @fileStuff
I've scoured the internet and it seems that the MIME type headers are correct but they do not seem to be working though. The browser seems to be opening the file and displaying the contents instead. This is problematic as the file is quite large. I get the same result on chrome and firefox.
Thanks!
EDIT:
my $path = "/home/blabla/Desktop/";
my $temp = $fileList[3];
warn ($temp);
my @fileholder;
push (@fileholder, "<$path/$temp");
print "Content-Type:application/x-download\n";
print "Content-Disposition:attachment;filename=$temp\n\n";
print @fileholder