in reply to Dancer and Excel::Writer::XLSX incompatibility?

send_file() needs a filename. It is not intended (I think) to send stuff that does not live on disk.

I think the best approach would be to simply send a normal response, with $buffer in the body.

Replies are listed 'Best First'.
Re^2: Dancer and Excel::Writer::XLSX incompatibility?
by Skeeve (Parson) on Jan 28, 2014 at 13:04 UTC

    That would not explain, why the test I posted works.

    And the documentation states:

    If you have your data in a scalar variable, send_file can be useful as well. Pass a reference to that scalar, and send_file will behave as if there was a file with that contents

    P.S.: I also tried working with a temporary file. It was the same result. Both, the file downloaded and the temporary one on the server, were corrupt.


    SOLVED!

    binmode($fh);

    It seems my Dancer application is injecting some CR/LF otherwise...

    Thanks for looking into it!


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e