Dojo (AJAX Framework) has something like IFrameIO which allows to upload files from form to server without reloading page, but the whole my page right now is written using prototype framework. Does prototype has something that I could use to get the same result? (Before I start editing my few thousands of code lines) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2007-Jul-10 07:40 UTC
Re: File Upload From Forms (something like Dojo have)
Dojo uses the iframe trick IIRC. You could look into: http://sean.treadway.info/articles/2006/05/29/iframe-remoting-made-easy http://sean.treadway.info/demo/upload/ http://www.ruby-forum.com/topic/113636 I prefer to use SWFUpload, because of its many clientside filtering abilities: http://swfupload.mammon.se/ Also look into this should you use SWFUpload: http:// blog.inquirylabs.com/2006/12/09/getting-the-_session_id-from-swfupload/ On 10 Jul 2007, at 08:10, david wrote:> Dojo (AJAX Framework) has something like IFrameIO which allows to > upload files from form to server without reloading page, but the whole > my page right now is written using prototype framework. Does prototype > has something that I could use to get the same result? (Before I start > editing my few thousands of code lines)Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Sébastien Gruhier
2007-Jul-10 07:46 UTC
Re: File Upload From Forms (something like Dojo have)
Am I wrong or SWFupload send all files as octet-stream so you are not able to get mime type in a rails application? Seb On Jul 10, 2007, at 9:40 AM, Peter De Berdt wrote:> Dojo uses the iframe trick IIRC. You could look into: > > http://sean.treadway.info/articles/2006/05/29/iframe-remoting-made- > easy > http://sean.treadway.info/demo/upload/ > http://www.ruby-forum.com/topic/113636 > > I prefer to use SWFUpload, because of its many clientside filtering > abilities: > http://swfupload.mammon.se/ > Also look into this should you use SWFUpload: http:// > blog.inquirylabs.com/2006/12/09/getting-the-_session_id-from- > swfupload/ > > On 10 Jul 2007, at 08:10, david wrote: > >> Dojo (AJAX Framework) has something like IFrameIO which allows to >> upload files from form to server without reloading page, but the >> whole >> my page right now is written using prototype framework. Does >> prototype >> has something that I could use to get the same result? (Before I >> start >> editing my few thousands of code lines) > > Best regards > > Peter De Berdt > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I feel its important to point out that prototype isn''t like dojo. From what I briefly read (to get a proper explaination) is that dojo is a toolkit. That is ''widget'' (bits of code you can drop in to do functionality) and ''event'' based, whereas prototype (which i am more familiar with) is more of a framework which extends Javascript to allow you to do some very cool flexible manipulations of data and acomplish tasks much quicker than you would if you were writing normal base javascript. Scriptaculous is an addon to Prototype (in that it uses prototype internally and is designed to go with it) that offers a few widget style functionalities, such as drag and drop sorting and autocomplete text boxes. So the original question of can I do iframe/ajax dynamic file uploads with prototype? Sure, if you code something to use the prototype methods/dom extensions to save the amount of code you have to write. As a prebuilt object you can just add into your page? Nope. Prototype has tonnes of features to help you here, such as the new Element constructor (actually i think this might be 1.6, not 1.5.1), but you can use the scriptaculous Builder syntax.. to Create the iframe, and attach events to button presses/image clicks to invoke your fileupload dialog. I haven''t read too much about how to do one of these uploads recently but as far as I know, a dummy webpage with a standard fileupload form is put into an iframe, which is manipulated via javascript via cross frame scripting to invoke the file dialog and submit the form. This iframe submits to a server script and returns the information about the file to the calling window/frame which then notifies the user their requested upload has completed. As for Sebastien''s question, someone else will need to answer that. Gareth On 7/10/07, Sébastien Gruhier <sgruhier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Am I wrong or SWFupload send all files as octet-stream so you are not able > to get mime type in a rails application? Seb > > On Jul 10, 2007, at 9:40 AM, Peter De Berdt wrote: > > Dojo uses the iframe trick IIRC. You could look into: > > > http://sean.treadway.info/articles/2006/05/29/iframe-remoting-made-easy > http://sean.treadway.info/demo/upload/ > http://www.ruby-forum.com/topic/113636 > > > I prefer to use SWFUpload, because of its many clientside filtering > abilities: > http://swfupload.mammon.se/ > Also look into this should you use SWFUpload: > http://blog.inquirylabs.com/2006/12/09/getting-the-_session_id-from-swfupload/ > > On 10 Jul 2007, at 08:10, david wrote: > > Dojo (AJAX Framework) has something like IFrameIO which allows to > upload files from form to server without reloading page, but the whole > my page right now is written using prototype framework. Does prototype > has something that I could use to get the same result? (Before I start > editing my few thousands of code lines) > > > Best regards > > > Peter De Berdt > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
After big pane for a while in my ass I managed to make it work with Dojo, but I started to think do I really want it? And the answer is no. Dojo is huge, it''s more complex and I must rely on it''s methods, while on prototype almost everything is done by myself. I have two ideas left, I will try to make it with prototype with iframe or do it the easiest way, just plain upload script and small pop-up window. I don''t know why, but I really don''t want to have something huge like Dojo in my source code. In some way it reminds me JAVA/C#. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I see.. you do have the right idea :) Gareth On 7/10/07, david <David.Abdurachmanov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > After big pane for a while in my ass I managed to make it work with > Dojo, but I started to think do I really want it? And the answer is > no. Dojo is huge, it''s more complex and I must rely on it''s methods, > while on prototype almost everything is done by myself. > > I have two ideas left, I will try to make it with prototype with > iframe or do it the easiest way, just plain upload script and small > pop-up window. I don''t know why, but I really don''t want to have > something huge like Dojo in my source code. In some way it reminds me > JAVA/C#. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
If you have a form like so : <form target="uploadDiv" action="http://path/to/handler"> <input type="file" name="filename" /> <input type="submit" value="Submit" /> </form> <iframe name="uploadDiv" style="width:0px; height:0px" url="_blank" /> Then, when the submit button will be pressed, your page will not refresh, but it''s the iframe that will be used to send the data from the form to the action url to the server. For the rest, look on how to send javascript to an iframe to talk with the javascript in you Web app. Or set up a timer that will look for any change in the iframe... Do not make the iframe invisible. Some browser don''t like that. Rather use a 0 sized iframe (like suggested). I could send you a script I wrote to send multiple files asynchronously using a PHP script and an iframe (with a little control over the file queue ; pause, stop, restart, etc.) But the code is not well documented (though not really hard to understand). I just went on with SWFUpload instead as I needed something to upload multiple files with progress bar all on client side. Cheers. yanick On Jul 10, 4:52 am, david <David.Abdurachma...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> After big pane for a while in my ass I managed to make it work with > Dojo, but I started to think do I really want it? And the answer is > no. Dojo is huge, it''s more complex and I must rely on it''s methods, > while on prototype almost everything is done by myself. > > I have two ideas left, I will try to make it with prototype with > iframe or do it the easiest way, just plain upload script and small > pop-up window. I don''t know why, but I really don''t want to have > something huge like Dojo in my source code. In some way it reminds me > JAVA/C#.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I wrote a howto on this exact topic with the tantalizing title, "ajax file upload". http://blog.caboo.se/articles/2007/4/2/ajax-file-upload HTH Courtenay On 7/10/07, Yanick <yanick.rochon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > If you have a form like so : > > <form target="uploadDiv" action="http://path/to/handler"> > <input type="file" name="filename" /> > <input type="submit" value="Submit" /> > </form> > > <iframe name="uploadDiv" style="width:0px; height:0px" url="_blank" /> > > Then, when the submit button will be pressed, your page will not > refresh, but it''s the iframe that will be used to send the data from > the form to the action url to the server. > > For the rest, look on how to send javascript to an iframe to talk with > the javascript in you Web app. Or set up a timer that will look for > any change in the iframe... > > Do not make the iframe invisible. Some browser don''t like that. Rather > use a 0 sized iframe (like suggested). > > I could send you a script I wrote to send multiple files > asynchronously using a PHP script and an iframe (with a little control > over the file queue ; pause, stop, restart, etc.) But the code is not > well documented (though not really hard to understand). I just went on > with SWFUpload instead as I needed something to upload multiple files > with progress bar all on client side. > > Cheers. > > yanick > > > On Jul 10, 4:52 am, david <David.Abdurachma...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > After big pane for a while in my ass I managed to make it work with > > Dojo, but I started to think do I really want it? And the answer is > > no. Dojo is huge, it''s more complex and I must rely on it''s methods, > > while on prototype almost everything is done by myself. > > > > I have two ideas left, I will try to make it with prototype with > > iframe or do it the easiest way, just plain upload script and small > > pop-up window. I don''t know why, but I really don''t want to have > > something huge like Dojo in my source code. In some way it reminds me > > JAVA/C#. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Yanick, I really would like to see your code, I am always open for new ideas how to make something. You know my email (you should see it, I think). And don''t worry, I will read the code... :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hello everyone. I have an upload page that worked perfectly using prototype 1.4, but fails with 1.5 and 1.5.1. I am not sure how to troubleshoot the failure. I have set up a test page to demonstrate the problem. http://clearimageonline.com/pages/start/prototypetests/index.html Any suggestions? Thanks, Terry Riegel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
i test with internet explrer and works fine, what is the problem? ----- Original Message ----- From: Terry Riegel To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sent: Wednesday, July 11, 2007 11:03 AM Subject: [Rails-spinoffs] Re: File Upload From Forms (something like Dojo have) Hello everyone. I have an upload page that worked perfectly using prototype 1.4, but fails with 1.5 and 1.5.1. I am not sure how to troubleshoot the failure. I have set up a test page to demonstrate the problem. http://clearimageonline.com/pages/start/prototypetests/index.html Any suggestions? Thanks, Terry Riegel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry for the short description earlier. I was in a rush. Here is what is happening. In Version 1.4 It works in all browsers. By "it works" I mean it will. 1. Upload a file 2. Show a progress bar while uploading In version 1.5 and 1.5.1 it seems to always fail to produce a working progress bar, and in some os/browser configurations it doesn''t upload at all. I tried to review the changelog for prototype, but it didn''t go back to 1.4. I would love to use at least version 1.5 for this and other projects but am not versed enough to determine how to troubleshoot this one. Thanks for any help. Terry Riegel On Jul 11, 2007, at 10:26 AM, Delfino Mario wrote:> i test with internet explrer and works fine, what is the problem? > ----- Original Message ----- > From: Terry Riegel > To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Sent: Wednesday, July 11, 2007 11:03 AM > Subject: [Rails-spinoffs] Re: File Upload From Forms (something > like Dojo have) > > Hello everyone. > > I have an upload page that worked perfectly using prototype 1.4, > but fails with 1.5 and 1.5.1. I am not sure how to troubleshoot the > failure. I have set up a test page to demonstrate the problem. > > http://clearimageonline.com/pages/start/prototypetests/index.html > > Any suggestions? > > Thanks, > > Terry Riegel > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I thought about progress bar, and as I can see it is possible to make using only iframe and without any AJAX at all. I will be trying to make this work today. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Terry, I took a quick look at your upload form. First and foremost, for debugging JS Application gotta get the Firebug. I was looking at the script and I noticed there was only one request to the server to get progress with the Prototype 1.5 versions, so maybe something has happened with Ajax.PeriodicalExecuter? The 1.4 Script did make two requests while i was uploading a windows sample image so it displayed 0 and 70%. Cheers On Jul 12, 3:56 am, david <David.Abdurachma...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I thought about progress bar, and as I can see it is possible to make > using only iframe and without any AJAX at all. I will be trying to > make this work today.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---