8 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9
my $db = $cgi->url_param('db'); my $datei = $cgi->url_param('datei'); download("/fester_pfad/".$db."/".$datei); sub download { my $file = shift; print $cgi->header(-type=>'application/octet-stream',-attachment=>$file); }
1
2
3
4
5
6
7
8
9
10
my $db = $cgi->url_param('db');
my $datei = $cgi->url_param('datei');
download("/fester_pfad/".$db."/".$datei);
sub download {
my $file = shift;
my $fn = (split "/", $file)[-1];
print $cgi->header(-type=>'application/octet-stream',-attachment=>$fn);
}
GwenDragon+2009-01-16 10:08:38--Code: (dl )my $fn = (split "/", $file)[-1];
1
2
3
4
5
6
7
8
9
10
11
12
use File::Basename;
my $db = $cgi->url_param('db');
my $datei = $cgi->url_param('datei');
download("/fester_pfad/".$db."/".$datei);
sub download {
my $file = shift;
my $fn = fileparse($file);
print $cgi->header(-type=>'application/octet-stream',-attachment=>$fn);
}
renee+2009-01-16 11:01:22-----
//Modedit Gwendragon: Tag für File::Basename geändert, da als dist nicht zu finden
---
8 Einträge, 1 Seite |