Hi,
I experience a strange issue:
I have two Perl scripts, we run the first from a web page and it diplays the files and dirctories to download, when you click on a file, it calls the second script
It displays a dialog box for download file, but it displays the name by changing the spca by "_", it dispays "test_1.txt" instead "test 1.txt"
I checked the name of the file in the system and its name is "test 1.txt", I dispayed the content of this variable $file and I gets "test 1.txt", but in the dialog box I get "test_1.txt".
Have you any idea why I get this conversion of space and "/" to "_" ?
thanks.
Here is the part of the second script:
======================
#!/usr/bin/perl -T
use strict;
use warnings;
use CGI;
my $q = CGI->new;
my($pfiles, $file) = $q->param('file') =~ m/(.*\/)(.*)$/;
if ($file) {
open(DWFILE, '<', "./$pfiles/$file") or return(0);
print $q->header(-type => 'application/x-download',
-attachment => "./$pfiles/$file",
'Content-length'=> -s "./$pfiles/$file");
binmode DWFILE;
print while <DWFILE>;
close (DWFILE);
}
I experience a strange issue:
I have two Perl scripts, we run the first from a web page and it diplays the files and dirctories to download, when you click on a file, it calls the second script
It displays a dialog box for download file, but it displays the name by changing the spca by "_", it dispays "test_1.txt" instead "test 1.txt"
I checked the name of the file in the system and its name is "test 1.txt", I dispayed the content of this variable $file and I gets "test 1.txt", but in the dialog box I get "test_1.txt".
Have you any idea why I get this conversion of space and "/" to "_" ?
thanks.
Here is the part of the second script:
======================
#!/usr/bin/perl -T
use strict;
use warnings;
use CGI;
my $q = CGI->new;
my($pfiles, $file) = $q->param('file') =~ m/(.*\/)(.*)$/;
if ($file) {
open(DWFILE, '<', "./$pfiles/$file") or return(0);
print $q->header(-type => 'application/x-download',
-attachment => "./$pfiles/$file",
'Content-length'=> -s "./$pfiles/$file");
binmode DWFILE;
print while <DWFILE>;
close (DWFILE);
}