[hunchentoot-devel] Publishing stream data?

Nicolas Neuss neuss at math.uni-karlsruhe.de
Mon Oct 1 08:47:30 UTC 2007


"Ram Krishnan" <rkris at kriyative.net> writes:

> Ah, you're absolutely right.
>
> Simply binding using LET, instead of WITH-OPEN-STREAM would do the trick then.
>
> Thanks.
>
> -ram

OK, thanks to everyone who responded (and especially to Edi for Hunchentoot
and all the other nice software).  I have now used something like the
following:

(define-easy-handler (csv-export-page :uri "/csv-export")
    ((csv :parameter-type 'boolean) ...)
  (when csv
    (setf (content-type) "text/comma-separated-values"
          (header-out "Last-Modified") (rfc-1123-date (get-universal-time))
          (content-length) nil)
    (let ((out (send-headers)))
      (csv-output :stream out ...)))
  (with-output-to-string (out)
    (fill-and-print-template "csv-export.html" values :stream out)))

As much as I can see, this works.

Yours, Nicolas




More information about the Tbnl-devel mailing list