diff --git a/custom/run.cgi b/custom/run.cgi index a9689e1a2..ffdd3ba7c 100755 --- a/custom/run.cgi +++ b/custom/run.cgi @@ -36,7 +36,11 @@ else { # Run and display output if ($cmd->{'format'} ne 'redirect' && $cmd->{'format'} ne 'form') { if ($cmd->{'format'}) { - print "Content-type: ",$cmd->{'format'},"\n"; + my ($f, $e) = $cmd->{'cmd'} =~ /([\p{L}\_\-\.0-9]+)\.(tar\..*?|[^.]*)$/; + my $filename = $f || 'download'; + my $extension = $e || 'unknown'; + print "Content-Disposition: attachment; filename=\"$filename.$extension\"\n"; + print "Content-type: application/x-download\n"; print "\n"; } else {