[Seaside] saving & uploading files?

Tim Rowledge seaside@lists.squeakfoundation.org
Wed, 28 Aug 2002 13:11:53 -0700


Julian Fitzell <julian@beta4.com> is claimed by the authorities to have written:

> Well, like I said, you *should* be able to just put an IAFileUpload in 
> your form, bound to a variable and that variable will contain the IAFile 
> object when the form is submitted.
Err, putting
<form sea:id="upload">
<iafileupload sea:id+"uploadedFile"></iafileupopload>
</form>
in my page gets me an error complaining about there not being a page
class set? Whaddididowrong?
I was going to try the www.w3.org pages to see if they explain anything,
but good old ATT won't let me resolve more than a few urls at the moment
and I can't get there...

> 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 :-)

tim 
-- 
Tim Rowledge, tim@sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Diagnostics are the programs that run when nothing else will.