[Seaside] download content & encoding

Johan Brichau johan at inceptive.be
Thu Nov 24 15:20:12 UTC 2011


Sebastian,

I noticed your question and, because we are also exporting csv but never seemed to bump into any encoding problem, I wonder if the following would not work for you.
We are doing it like this:

html anchor
    	callback: [self requestContext respond: [ :response |
							response 
								attachmentWithFileName: 'yesplan',Date today yyyymmdd,'.csv';
								contentType: (WAMimeType main: 'text' sub: 'csv');
								nextPutAll: (String streamContents: [:str | self exportCSVOn: str])]];

Works for you too?

cheers
Johan

On 24 Nov 2011, at 14:52, Sebastian Sastre wrote:

> done.
> 
> It works.
> 
> Note that mime type is text/csv and it will answer false to #isBinary so it needed tweaking there
> 
> sebastian
> 
> o/
> 
> On Nov 23, 2011, at 7:06 PM, Lukas Renggli wrote:
> 
>> On 23 November 2011 21:38, Sebastian Sastre
>> <sebastian at flowingconcept.com> wrote:
>>> Hi guys,
>>> setting an anchor to download a document encodes the content right?
>>> there is a way to make seaside not to encode the document?
>>> sebastian
>>> o/
>> 
>> Set the response to binary.
>> 
>> Lukas
>> 
>> 
>>> 
>>> _______________________________________________
>>> seaside mailing list
>>> seaside at lists.squeakfoundation.org
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>> 
>>> 
>> 
>> 
>> 
>> -- 
>> Lukas Renggli
>> www.lukas-renggli.ch
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> 
> 
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list