I am trying to send a file to the user so they can download it. I have it working but I want to make it conform to mod_perl but I don't know how to convert what I have to be more mod_perl like.
Basically this is what I send to the client. There is more above this but I don't need help on that.
# Three lines I want to change:
$r->print("Content-Disposition: attachment; filename=\"$fileName\"\n\n");
#creating the excel file
#opening the file
my $XLS = Symbol::gensym();
open $XLS, "$path" or die "Can't open $path: $!\n";
binmode( $XLS );
#sending the file to the client
The part I want to change but can't seem to find any good info on is the sending of the Content-Diposition. This is what I have so far:
Any help would be appreciated. Also, am I sending the file correctly? It works but are there better ways?