[dancer-users] send_file for new content

Rick Leir richard.leir at canadiana.ca
Thu Sep 24 14:13:23 BST 2015


On Thu, Sep 24, 2015 at 7:00 AM, <dancer-users-request at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150924/d691d5b8/attachment.html>


More information about the dancer-users mailing list