[Seaside] Not able to upload [a Seaside.WAFile] through onClick
dirk newbold
dirkdirk at gmail.com
Thu Sep 20 07:42:09 UTC 2007
I think I'm batting out of my league here but I'm keen to learn.
How would I implement Andrius's code?
Below is my attempt to implement Lukas's code but it is not recognising
submit, any ideas?
Cheers,
Dirk
html form multipart; id: 'pictureUpload'; with: [
html form id: 'fileupload'; multipart; with: [
html fileUpload
callback: [ : val | self product picture1: val ];
onChange: (Seaside.SUForm new id: 'fileupload'; submit )].
html submitButton
onClick: (html updater
id: 'uploadProductPictures';
triggerForm: 'pictureUpload';
callback: [ :r | self renderUploadPictures: r ];
return: false);
text: 'Save' ]
On 9/20/07, Andrius Paulavicius <apaulavicius at gmail.com> wrote:
>
> use an hidden iframe for forms target
>
> html iframe name: 'uiframe'.
>
> html form
> attributeAt: 'target' put: 'uiframe';
> ...
>
> ----- Original Message -----
> From: dirk newbold
> To: Seaside - general discussion
> Sent: Thursday, September 20, 2007 1:03 AM
> Subject: Re: [Seaside] Not able to upload [a Seaside.WAFile] through
> onClick
>
>
> Cheers, I'll give it a go
>
>
> On 9/19/07, Lukas Renggli <renggli at gmail.com> wrote:
> > But instead of returning "a Seaside.WAFile" it is returning the
> directory
> > path.
>
> File-upload do not work through XmlHttpRequest due to security
> restrictions in the web-browser.
>
> The easiest solution is to have a separate form around the upload
> field and commit the whole form. Something along ...
>
> html form id: 'fileupload'; multipart; with: [
> html fileUpload
> callback: [ :file | ... ];
> onChange: (SUForm new
> id: 'fileupload';
> submit) ]
>
> If you want to go the AJAX way you have to do some nasty tricks using
> IFRAMES to push the data to the server. This is also what GMail is
> doing for their file uploads for example.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20070920/ec2f5c26/attachment-0001.htm
More information about the seaside
mailing list