mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Support possible media streaming in progressive output https://github.com/webmin/webmin/issues/1250 75517a865d
This commit is contained in:
@@ -90,7 +90,9 @@ print &ui_table_row(&hlink($text{'edit_format'}, "format"),
|
||||
[ [ 0, $text{'edit_format0'} ],
|
||||
[ 2, $text{'edit_format2'} ],
|
||||
[ 3, $text{'edit_format3'} ],
|
||||
[ 1, $text{'edit_format4'} ] ]), 3);
|
||||
[ 1, $text{'edit_format1'}." ".
|
||||
&ui_textbox("format",
|
||||
$fmode == 1 ? $cmd->{'format'} : "", 20) ] ]), 3);
|
||||
|
||||
# Show Webmin servers to run on
|
||||
@servers = &list_servers();
|
||||
|
||||
@@ -39,8 +39,12 @@ if ($cmd->{'format'} ne 'redirect' && $cmd->{'format'} ne 'form') {
|
||||
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";
|
||||
my $ctype = 'inline';
|
||||
if ($cmd->{'format'} =~ /^application/) {
|
||||
$ctype = 'attachment';
|
||||
}
|
||||
print "Content-Disposition: $ctype; filename=\"$filename.$extension\"\n";
|
||||
print "Content-type: ",$cmd->{'format'},"\n";
|
||||
print "\n";
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -66,7 +66,9 @@ else {
|
||||
$cmd->{'format'} = 'form';
|
||||
}
|
||||
else {
|
||||
$cmd->{'format'} = 'download';
|
||||
$in{'format'} =~ /^[a-z0-9\.\_\-]+\/[a-z0-9\.\_\-]+/i ||
|
||||
&error($text{'save_eformat'});
|
||||
$cmd->{'format'} = $in{'format'};
|
||||
}
|
||||
$cmd->{'noshow'} = $in{'noshow'};
|
||||
$cmd->{'usermin'} = $in{'usermin'};
|
||||
|
||||
Reference in New Issue
Block a user