Allow programmer to set the filename of a resulting file.
This commit is contained in:
parent
7620eb2ee8
commit
fc8808c5c0
1 changed files with 9 additions and 4 deletions
|
|
@ -179,13 +179,18 @@ sub end {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub httpHeader {
|
sub httpHeader {
|
||||||
my ($charset);
|
unless ($session{header}{charset}) {
|
||||||
($charset) = WebGUI::SQL->quickArray("select characterSet from language where languageId=".$session{user}{language});
|
my ($charset) = WebGUI::SQL->quickArray("select characterSet from language where languageId=".$session{user}{language});
|
||||||
$charset = "ISO-8859-1" if ($charset eq "");
|
$session{header}{charset} = $charset || "ISO-8859-1";
|
||||||
|
}
|
||||||
|
if ($session{header}{filename} && $session{header}{mimetype} eq "text/html") {
|
||||||
|
$session{header}{mimetype} = "application/octet-stream";
|
||||||
|
}
|
||||||
return $session{cgi}->header(
|
return $session{cgi}->header(
|
||||||
-type => $session{header}{mimetype}.'; charset='.$charset,
|
-type => $session{header}{mimetype}.'; charset='.$charset,
|
||||||
-cookie => $session{header}{cookie},
|
-cookie => $session{header}{cookie},
|
||||||
-status => $session{header}{status}
|
-status => $session{header}{status},
|
||||||
|
-attachment => $session{header}{filename}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue