[Seaside] saving & uploading files?

Colin Putney seaside@lists.squeakfoundation.org
Wed, 28 Aug 2002 13:54:57 -0700


Tim responded to Julian's suggestion:


>> You could do something like:
>>
>> mimeDocument
>>   ^ MIMEObject contentType: 'text/plain' content: 'This is a test'
> Whoops, MIMEDocument!
>>
>>
>> So now if you do:
>>
>> self callPage: IAMyDynamicResourceSubclass new
>>
>> the user would be prompted to download a text file.  Actually, in this
>> case the browser would probably just display it since it is 
>> 'text/plain'
>> hopefully that gets the idea across.
> That works ok, although as you say it is plain text and just gets
> displayed. Can't think of any plausible alternative formatto use right
> now. MP3 is not exactly appropriate :-)

Using 'application/octet-stream' would indicate a binary file. That 
might not be appropriate to the files you're actually producing, but it 
would be fine for a test. The browser should offer to save the file to 
disk.


Colin Putney
Whistler.com