F
FLUX (a l'Ircam)
Hi Perl folk!
I have the following problem :
I want to upload a file (stored in a web server) to the browser, and then
delete the file in the server. This file contains the results of a sound
analysis/synthesis and is named XXX.zip with XXX the basename of the
initial sound file...
If I used: "redirect(-uri=>$UPLOAD_DIR/my_file.zip);"
it would be OK, but then I can't delete the file after it is
downloaded...
So I did the following :
<CODE>
print header(-type=>'application/zip');
open UPLOADFILE, "<$UPLOAD_DIR/$my_file.zip";
binmode UPLOADFILE;
while ( <UPLOADFILE> ){
print ;
}
close UPLOADFILE;
`rm -fr $UPLOAD_DIR/my_file.zip`;
</CODE>
But there is a big problem with that : when the user download the zip file
it is named like the cgi script : for exemple "get_result.cgi" instead of
"sound56.zip"
Is there a way to force a name? Maybe using an option in the header?
I read the CGI.pm perldoc and googled it, but I could'nt find anything of
value...
PS : sorry if you find this question stupid, but I'm quite new to Perl...
Flux
I have the following problem :
I want to upload a file (stored in a web server) to the browser, and then
delete the file in the server. This file contains the results of a sound
analysis/synthesis and is named XXX.zip with XXX the basename of the
initial sound file...
If I used: "redirect(-uri=>$UPLOAD_DIR/my_file.zip);"
it would be OK, but then I can't delete the file after it is
downloaded...
So I did the following :
<CODE>
print header(-type=>'application/zip');
open UPLOADFILE, "<$UPLOAD_DIR/$my_file.zip";
binmode UPLOADFILE;
while ( <UPLOADFILE> ){
print ;
}
close UPLOADFILE;
`rm -fr $UPLOAD_DIR/my_file.zip`;
</CODE>
But there is a big problem with that : when the user download the zip file
it is named like the cgi script : for exemple "get_result.cgi" instead of
"sound56.zip"
Is there a way to force a name? Maybe using an option in the header?
I read the CGI.pm perldoc and googled it, but I could'nt find anything of
value...
PS : sorry if you find this question stupid, but I'm quite new to Perl...
Flux