Jaryl Sim wrote: > If that's the case, then you should split it up into multiple > requests. I believe that you can only send back one response per > request, so that is an inherent problem.
Sure that's the case, that's how HTTP protocol works. One response for one request. I think of it as similar to an event loop, where each cycle through the loop processes one event. The difference is that an event loop is continuous, where a request-response cycle sleeps between each cycle. In other words the event loop runs continuously checking an event queue, where as HTTP sleeps until it is sent a request, which causes it to "awake" and process the request and generate a response. After the response is processes it sleeps again until awoken by another request. > Perhaps you may try sending a request once the a valid file is > selected in the file upload field. As far as I know, the behavior you're after is going to require some client-side code. I know there are a number of solutions floating around, some taking advantage of Flash (as I assume the swfupload does). Some others I've heard of make use of a Java applet. But, I would imagine this behavior could be built with JavaScript/AJAX. In any case I think the "brains" of this feature will need to be implemented client-side. The AJAX should be able to send requests to a server-side action responsible to accepting one file, and the client-side code would make one request per file, plus additional request to manipulate the DOM. Please note this is all speculation. I have no proof-of-concept code to offer. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---