<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">&gt; Hi there,<br>
&gt;<br>
&gt; I know people consider serving files a job that should be handled by a<br>
&gt; &quot;real&quot; http server rather than Seaside. In most cases, esp. for static<br>
&gt; resources that can be accessed by the public, that is absolutely the case.<br>
&gt;<br>
&gt; But I need to serve files in a callback. The files are being partly<br>
&gt; calculated and read from a DB and should be available for download by<br>
&gt; clicking on a link.<br>
&gt;<br>
&gt; I&#39;ve been looking into WAFileLibrary and WAFileHandler, but am not sure<br>
&gt; where to start.<br>
&gt;<br>
&gt; What I want to do is something like:<br>
&gt;<br>
&gt; html anchor<br>
&gt;  callback: [self calculateChartAndServeIt]<br>
&gt;  with: &#39;Download full chart&#39;.<br>
&gt;<br>
&gt; I know I will have to respond:, but can I do that in a callback?<br>
&gt;<br>
&gt; Joachim<br></div></div></blockquote><div><br>I do a very similar thing in my application.  Generate a file and serve it up to the user.  So far this has worked well:<br>downloadtext: contents named: aFilename<br>    &quot;trigger a file download operation for aFilename with the contents in contents&quot;<br>
<br>    self requestContext respond: [ : response |<br>        response contentType: &#39;text/plain&#39;;<br>        attachmentWithFileName: aFilename;<br>        nextPutAll: contents.<br>    ].<br><br><br>where &quot;contents&quot; is a string containing the text of the file to download<br>
 <br></div></div>