http://www.perlmonks.org?node_id=1097371


in reply to Re^2: Write a Filehandle w/Dancer2
in thread Write a Filehandle w/Dancer2

Tried this, but it gives a 404 error:

return send_file( '/dev/null', streaming => 1, system_path => 1, content_type => $mime_type, callbacks => { override => sub { my ($respond, $response) = @_; my $writer = $respond->([ 200, {} ]); my $buf = ''; while( read( $in_fh, $buf, VID_READ_LENGTH ) ) { $writer->write( $buf ); } } }, );

Debugger still shows that the callback isn't called.


"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Replies are listed 'Best First'.
Re^4: Write a Filehandle w/Dancer2
by Anonymous Monk on Aug 14, 2014 at 07:12 UTC

    I do believe that the docs for Dancer2 send_file are more "wishlist" or "todo" than "this is how it works", this is based of my reading of send_file and Dancer2::Handler::File

    send the bug upstream :)