Uploading Files with Canvas

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Uploading Files with Canvas

Rick Zaccone
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

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

SCPageUploader.st (2K) Download Attachment