Hi, I''m using Ajax to submit forms but the ajax form object don''t have suport to upload files from the form. My system don''t have page reload, use every time XMLHTTPRequest to change the page, including when someone submit a form. But now I''m need to submit a file and how I serialize this? Because is the Browser(Firefox) that get the file from pc and submit to "action" page. Do you know what can I try?? Thank you -- Pedro C. Valentini pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org +55 (21) 8708-8035
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Pedro Valentini wrote: | | Hi, | I''m using Ajax to submit forms but the ajax form object don''t have | suport to upload files from the form. | My system don''t have page reload, use every time XMLHTTPRequest to | change the page, including when someone submit a form. | But now I''m need to submit a file and how I serialize this? Because is | the Browser(Firefox) that get the file from pc and submit to "action" page. | | Do you know what can I try?? yeah, I don''t suppose that it would work. It may just need some hacking to get the form/multipart encoding into the submission - -- David Morton Maia Mailguard server side anti-spam/anti-virus solution: http://www.maiamailguard.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCUbsOSIxC85HZHLMRAjA9AJ97uKNmfwatgtAqDelJWtmNzkA5iACfSR4I /fBvXY6X/c1pFzKL5o6Mwlc=4PxS -----END PGP SIGNATURE-----
Pedro Valentini wrote:> > Hi, > I''m using Ajax to submit forms but the ajax form object don''t have > suport to upload files from the form. > My system don''t have page reload, use every time XMLHTTPRequest to > change the page, including when someone submit a form. > But now I''m need to submit a file and how I serialize this? Because is > the Browser(Firefox) that get the file from pc and submit to "action" page. > > Do you know what can I try?? > > Thank you >You can use Ajax for multipart form submits. Create an iframe in Javascript and submit the form to it. jeremy
Jeremy Kemper wrote:> Pedro Valentini wrote: > >>Hi, >>I''m using Ajax to submit forms but the ajax form object don''t have >>suport to upload files from the form. >>My system don''t have page reload, use every time XMLHTTPRequest to >>change the page, including when someone submit a form. >>But now I''m need to submit a file and how I serialize this? Because is >>the Browser(Firefox) that get the file from pc and submit to "action" page. >> >>Do you know what can I try?? >> >>Thank you >> > > > You can use Ajax for multipart form submits. Create an iframe in > Javascript and submit the form to it.Pardon: can''t. jeremy
You can''t do this with XMLHTTPRequest, because file upload fields can''t be serialized. You can set a "target" attribute on the form tag, and send the output to a iframe, though. Note that i''m currently implementing helper functions to easily do this (and to allow feedback on upload progress). thomas Am 04.04.2005 um 23:36 schrieb Pedro Valentini:> > Hi, > I''m using Ajax to submit forms but the ajax form object don''t have > suport to upload files from the form. > My system don''t have page reload, use every time XMLHTTPRequest to > change the page, including when someone submit a form. > But now I''m need to submit a file and how I serialize this? Because is > the Browser(Firefox) that get the file from pc and submit to "action" > page. > > Do you know what can I try?? > > Thank you > > -- > > Pedro C. Valentini > pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org > +55 (21) 8708-8035 > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I''m traing with a iframe. Where can I see about your functions? Thank you Pedro C. Valentini pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org +55 (21) 8708-8035 Thomas Fuchs escreveu:> You can''t do this with XMLHTTPRequest, because file upload fields > can''t be serialized. > You can set a "target" attribute on the form tag, and send the output > to a iframe, though. > > Note that i''m currently implementing helper functions to easily do > this (and to allow feedback on > upload progress). > > thomas > > Am 04.04.2005 um 23:36 schrieb Pedro Valentini: > >> >> Hi, >> I''m using Ajax to submit forms but the ajax form object don''t have >> suport to upload files from the form. >> My system don''t have page reload, use every time XMLHTTPRequest to >> change the page, including when someone submit a form. >> But now I''m need to submit a file and how I serialize this? Because >> is the Browser(Firefox) that get the file from pc and submit to >> "action" page. >> >> Do you know what can I try?? >> >> Thank you >> >> -- >> >> Pedro C. Valentini >> pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org >> +55 (21) 8708-8035 >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Pedro C. Valentini pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org +55 (21) 8708-8035
See http://dev.rubyonrails.com/attachment/ticket/1026/ upload_progress_helper.rb Note that this is beta code, and may have bugs. This will allow you to do this with almost no effort -- maybe you just wait for the next RoR release or so when it gets included... Thomas Am 05.04.2005 um 19:20 schrieb Pedro Valentini:> > I''m traing with a iframe. > Where can I see about your functions? > > Thank you > > Pedro C. Valentini > pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org > +55 (21) 8708-8035 > > > > > > Thomas Fuchs escreveu: > >> You can''t do this with XMLHTTPRequest, because file upload fields >> can''t be serialized. >> You can set a "target" attribute on the form tag, and send the output >> to a iframe, though. >> >> Note that i''m currently implementing helper functions to easily do >> this (and to allow feedback on >> upload progress). >> >> thomas >> >> Am 04.04.2005 um 23:36 schrieb Pedro Valentini: >> >>> >>> Hi, >>> I''m using Ajax to submit forms but the ajax form object don''t have >>> suport to upload files from the form. >>> My system don''t have page reload, use every time XMLHTTPRequest to >>> change the page, including when someone submit a form. >>> But now I''m need to submit a file and how I serialize this? Because >>> is the Browser(Firefox) that get the file from pc and submit to >>> "action" page. >>> >>> Do you know what can I try?? >>> >>> Thank you >>> >>> -- >>> >>> Pedro C. Valentini >>> pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org >>> +55 (21) 8708-8035 >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> > > -- > > Pedro C. Valentini > pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org > +55 (21) 8708-8035 > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I''m traing with a iframe. Where can I see about your functions? Thank you Pedro C. Valentini pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org +55 (21) 8708-8035> > > > > > Thomas Fuchs escreveu: > >> You can''t do this with XMLHTTPRequest, because file upload fields >> can''t be serialized. >> You can set a "target" attribute on the form tag, and send the output >> to a iframe, though. >> >> Note that i''m currently implementing helper functions to easily do >> this (and to allow feedback on >> upload progress). >> >> thomas >> >> Am 04.04.2005 um 23:36 schrieb Pedro Valentini: >> >>> >>> Hi, >>> I''m using Ajax to submit forms but the ajax form object don''t have >>> suport to upload files from the form. >>> My system don''t have page reload, use every time XMLHTTPRequest to >>> change the page, including when someone submit a form. >>> But now I''m need to submit a file and how I serialize this? Because >>> is the Browser(Firefox) that get the file from pc and submit to >>> "action" page. >>> >>> Do you know what can I try?? >>> >>> Thank you >>> >>> -- >>> >>> Pedro C. Valentini >>> pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org >>> +55 (21) 8708-8035 >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> >-- Pedro C. Valentini pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org +55 (21) 8708-8035
Thomas, Hey this sounds great. Where can we track your progress? On Apr 4, 2005 6:37 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: ...> Note that i''m currently implementing helper functions to easily do this > (and to allow feedback on > upload progress). > > thomas
I''ve written a bit on this (including a demo video) at http://mir.aculo.us/th0fu/upload-progress-with-ruby-on-rails-and-ajax- demo-movie/view The patch is available at http://dev.rubyonrails.com/ticket/1026. Note: The upload progress is not really "ready" yet, as it doesn''t work correctly with lighttpd. Apache+fast_cgi should work... Thomas Am 08.04.2005 um 3:35 schrieb Obie Fernandez:> Thomas, > > Hey this sounds great. Where can we track your progress? > > On Apr 4, 2005 6:37 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: > ... >> Note that i''m currently implementing helper functions to easily do >> this >> (and to allow feedback on >> upload progress). >> >> thomas > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Thomas Fuchs wrote:> I''ve written a bit on this (including a demo video) at > http://mir.aculo.us/th0fu/upload-progress-with-ruby-on-rails-and-ajax- > demo-movie/view > > The patch is available at http://dev.rubyonrails.com/ticket/1026.This looks very promising. Keep it up! -- Lee
Sean Treadway and I have just released our final version of the patch at http://dev.rubyonrails.com/ticket/1026 -- it''s diffed against svn revision 1113. So, if you''re adventurous, try it out... :) Also: new video with a nice progress bar at http://mir.aculo.us/ Thomas Am 09.04.2005 um 0:35 schrieb Lee O''Mara:> Thomas Fuchs wrote: >> I''ve written a bit on this (including a demo video) at >> http://mir.aculo.us/th0fu/upload-progress-with-ruby-on-rails-and- >> ajax- demo-movie/view >> The patch is available at http://dev.rubyonrails.com/ticket/1026. > > This looks very promising. Keep it up! > > -- > Lee > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >