[Seaside] (no subject)
maarten.mostert at wanadoo.fr
Sun Jul 22 10:22:56 UTC 2007
Philippe Marschall a écrit :
> 2007/7/22, Keith Hodges <keith_hodges at yahoo.co.uk>:
>> Maarten MOSTERT wrote:
>> > Hi,
>> > I am trying to add a download button to my application to serve a
>> 20MB application file.
>> > I don't manage figure out how to make button that triggers a
>> download dialog ?
>> > I also wonder if MyFileLibrary is the right way to do so ?
>> > Thanks in adavance,
>> > @+Maarten,
>> Hello Maarten,
>> some code from Gjallar for doing this
>> Rendering the anchor:
>> callback: [attachment downloadInSession:
>> self session]
>> tooltip: 'Download file';
>> with: [ html html: attachment
>> Attachment-downloadInSession: session
>> | stream |
>> stream := self readStream.
>> session download: stream mimeType: stream mimeType filename:
>> WASession-download: contents mimeType: mimeType filename: fileName
>> self respond: [:url |
>> (WAResponse new)
>> contentType: mimeType;
>> headerAt: 'Content-Disposition' put: 'attachment;
>> filename="' , fileName , '"';
>> headerAt: 'Content-length' put: contents size printString;
>> contents: contents;
> Will this block the sesion until the download is finished?
I haven't been able to get this working as I don't have the supposed
Attachement Class in my VW system.
I found a Class called AttachmentFilename though in HTTP so maybe this
is the one to use.
Maybe I can simply fork the download action in a new session ?
>> This download method is available as an extension to base seaside in
>> repository http://www.squeaksource.com/Jetsam
>> Seaside mailing list
>> Seaside at lists.squeakfoundation.org
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
More information about the Seaside