Hello, does someone knows how gmail does file upload when the attached files are automatically saved in drafts ? I am trying to do it in Scriptalicious/Prototype but I don''t see how they get the file on the system using js... Tarek _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Tarek Ziadé wrote:> Hello, > does someone knows how gmail does file upload when the attached files > are automatically saved in drafts ? > > I am trying to do it in Scriptalicious/Prototype but I don''t see how > they get > the file on the system using js...I don''t know how (if) it can be done with Prototype/script.aculo.us but I have seen a blog post about uploading with Dojo, but I''m not sure of the full code needed for that: http://alex.dojotoolkit.org/?p=528 HTH Danilo Celic
The only way to submit files via AJAX is to submit the form to an iframe and have the page loaded after submission call some javascript functions in the parent window. I used to do this years ago before all the AJAX buzz for submitting changes and refreshing data, and it''s still the only method for uploading files. The reason is security; you cannot give javascript access to file data on a person''s hard drive. Dojo creates an iframe and submits the form to it, according to that link you posted. Something could easily be created for Prototype to do the same thing, and in fact I might need such functionality in the near future. If I write something, I''ll be sure to share it. Greg> > I don''t know how (if) it can be done with Prototype/script.aculo.usbut I> have seen a blog post about uploading with Dojo, but I''m not sure ofthe> full code needed for that: > http://alex.dojotoolkit.org/?p=528
On 1/5/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote:> > The only way to submit files via AJAX is to submit the form to an iframe > and have the page loaded after submission call some javascript functions > in the parent window. I used to do this years ago before all the AJAX > buzz for submitting changes and refreshing data, and it''s still the only > method for uploading files. The reason is security; you cannot give > javascript access to file data on a person''s hard drive. > > Dojo creates an iframe and submits the form to it, according to that > link you posted. > > Something could easily be created for Prototype to do the same thing, > and in fact I might need such functionality in the near future. If I > write something, I''ll be sure to share it.Great, thanks to both of you, i am going to investigate the iframe technique Tarek Greg> > > > > I don''t know how (if) it can be done with Prototype/script.aculo.us > but I > > have seen a blog post about uploading with Dojo, but I''m not sure of > the > > full code needed for that: > > http://alex.dojotoolkit.org/?p=528 > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- Tarek Ziadé | www.afpy.org Python - why settle for snake oil when you can have the whole snake? (Mark Jackson) _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
It''s also possible to use a hidden Flash element on the page, if you don''t mind going that route. The added benefit being that you can post MULTIPLE files at the same time. Check out "BubbleShare" for an example: http://www.bubbleshare.com Here''s some reference on the subject: http://www.emllabs.com/article.php?articleId=121 http://www.emllabs.com/article.php?articleId=122> > Hello, > > does someone knows how gmail does file upload when the > attached files > > are automatically saved in drafts ? > > > > I am trying to do it in Scriptalicious/Prototype but I > don''t see how > > they get the file on the system using js...