On Thu, Sep 24, 2015 at 7:00 AM, <dancer-users-request@dancer.pm> wrote:

>>     return send_file(
>>         \$content,
>>         content_type => 'application/vnd.ms-excel',
>>         filename     => "filename.xls",
>>     );
>>
>> It goes without saying that given recent developments you should
>> consider using Open Document Format instead ;-)
> [KB] I will try and inform you as early as possible, thanks
>>
[KB] As I read from tutorial, send_file returns a file which already
exists. It does not create a new file with new content.

This example sends html, but you could create other types of data. HTH.

    my $ret_html = <<HTDATA;
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Example</title>
</head>
<body>
</body>
</html>
HTDATA

    send_file( \$ret_html, content_type => 'text/html');

Cheers -- Rick