[Seaside] Serving a file

Sven Van Caekenberghe sven at beta9.be
Sun Oct 17 18:14:55 UTC 2010


Thierry,

On 17 Oct 2010, at 18:11, Thierry Thelliez wrote:

> I need to generate some file based reports (Excel). Some of these
> reports are generated on the fly, some others (the long ones) will be
> pre-generated.
> 
> For the reports generated on the fly (when users click a button), how
> do I set a page type to be something like:  application/vnd.ms-excel
> (extension xml or csv). ?


Some time ago I posed the same question on this list and Julian Fritzel helped me to this answer:

servePdf
	self requestContext respond: [ :response |
		response 
			document: self getPdfBytes mimeType: 'application/pdf' fileName: 'seaside-test.pdf';
      		doNotCache ]

HTH,

Sven



More information about the seaside mailing list