[dancer-users] return content file

Hugues hugues at max4mail.com
Wed Sep 23 21:36:04 BST 2015


Hello WK
thanks for you help

I found the solution in Dancer.pm source code

  if (exists($options{filename})) {
             $resp->push_header('Content-Disposition' =>
                 "attachment; filename=\"$options{filename}\""
             );

just remove filename in params of send_file, and there are no 
Content-Disposition

send_file( $fullpath, streaming => 1, content_type => $content_type, 
system_path => 1);

thanks lot
Hugues


Le 23/09/2015 21:48, WK a écrit :
> Hi!
>
> 2015-09-23 22:35 GMT+03:00 Hugues <hugues at max4mail.com>:
>
>> If I open this link in with firefox ,
>> http://localhost/download/560297bbc96186eea22e0f31/image/index.html
>> 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 ?
> If html-does not show up in bowser, my first tought is to check
> content_type (it should be text/html). Maybe is involved some other
> header, like Content-disposition. Check response headers.
>
> Wbr,



More information about the dancer-users mailing list