[Seaside] Uploading Files with Canvas

Rick Zaccone zaccone at bucknell.edu
Wed Apr 12 22:44:57 UTC 2006


About a year ago, David Shaffer posted an example that shows how to  
upload a file <http://article.gmane.org/ 
gmane.comp.lang.smalltalk.squeak.seaside/2587/>.   Here is his  
renderContentOn: method.

renderContentOn: html
     html attributeAt: 'enctype' put: 'multipart/form-data'.
     html
         form: [html
                 fileUploadWithValue: self lastFilenameOrEmptyString
                 callback: [:f | self fileSent: f].
             html submitButtonWithText: 'Send file']

I am playing with getting this to work with canvas.  Here is what I  
have:

renderContentOn: html
     html form
         attributeAt: 'enctype' put: 'multipart/form-data';
         with:
                 [html fileUpload
                     value: self lastFilenameOrEmptyString;
                     callback: [:f | self fileSent: f].
                 html submitButton text: 'Send file']

This allows me to select a file, but when I press the Send file  
button, I get a message saying "That page has expired".  Does anyone  
know what's wrong?  I've attached the source code to this message.

Rick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SCPageUploader.st
Type: application/octet-stream
Size: 1790 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20060412/90ac57b9/SCPageUploader.obj


More information about the Seaside mailing list