[Seaside] Value of a fileUpload element?

Jan van de Sandt jvdsandt at gmail.com
Wed Jan 14 15:20:26 UTC 2009

Hello list,

I am creating a form which includes a fileUpload element. Whenever the user
changes the file I want to receive a callback with the new filename so I can
do some server-side changes like setting the correct Content-Type etc.

I am using Seaside 2.9.0-alpha2 with JQuery.

Currently the fileUpload code looks like this:

            html paragraph: [
                html fileUpload
                    id: (uploadId := html nextId);
                    name: 'file';
                    onChange: ((html jQuery id: 'pid') load
                        addParameter: 'dummy' -> ((html jQuery id: uploadId)
                        html: [ :h | self hanldeNewFile: h. h text: 'Haai'

I can add the filename to the callback url using addParameter: but I don't
know how to read this parameter from the callback Smalltalk code. I also
tried to "serialize" the fileUpload element but this doesn't seem to work
for file input elements.

Can anobody tell me how I can read the parameter value from the callback

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20090114/876f0305/attachment.htm

More information about the seaside mailing list