[dancer-users] return content file

Hugues hugues at max4mail.com
Wed Sep 23 20:35:50 BST 2015

I'm looking for a solution of this problem:
I use Dancer1

I would like to control directory access and return the content as web share
the access control part is ok.

get '/donwload/**' => sub {
                 if ( Access control is OK ) {

                 my ($file) = splat;
                 my @file   = @{ $file };
                 my $path= join('/', @file);
                 my $fullpath='/home/media/files/'.$path;
                 my $content_type = mimetype($fullpath);
                 send_file( $fullpath, streaming => 1, filename => 
$file[-1], content_type => $content_type, system_path => 1);


If I open this link in with firefox , 
firefox launch a download of index.html.

  I don't want a download, I want html code directly as apache do.

if someone has a idea, how I can do this ?


More information about the dancer-users mailing list