[Seaside] Serving files from within Seaside

Diego Lont diego.lont at delware.nl
Tue Dec 18 12:03:57 UTC 2012


Hi Joachim,

Looking into WAFileLibrary and WAFileHandler won't help a lot: you get easily lost. They are great for serving static files, and do some buffering and such.

In Seaside 3.x the answer is more simple. Your code looks fine, the method you want to make looks something like:

calculateChartAndServeIt
	self requestContext respond: [ :response |
		response
			doNotCache;
			document: self calculateChart ]

Diego

On Dec 18, 2012, at 8:53 AM, jtuchel wrote:

> Hi there,
> 
> I know people consider serving files a job that should be handled by a
> "real" http server rather than Seaside. In most cases, esp. for static
> resources that can be accessed by the public, that is absolutely the case.
> 
> But I need to serve files in a callback. The files are being partly
> calculated and read from a DB and should be available for download by
> clicking on a link.
> 
> I've been looking into WAFileLibrary and WAFileHandler, but am not sure
> where to start.
> 
> What I want to do is something like:
> 
> html anchor
>  callback: [self calculateChartAndServeIt]
>  with: 'Download full chart'.
> 
> I know I will have to respond:, but can I do that in a callback?
> 
> Joachim
> 
> 
> 
> 
> --
> View this message in context: http://forum.world.st/Serving-files-from-within-Seaside-tp4659745.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list