Hi I have a form like <%= form_remote_tag :url => { :action => ''attach_file'', :id => @sd_ticket.id }, :enctype => ''multipart/form-data'' %> <table cellpadding="4" cellspacing="0" border="0" width="100%" class="itiltable2"> <tr> <td width="25%"><%= text_area "service_desk_attachment1", "description", "cols" => 50, "rows" => 1 %></td> <td width="25%" colspan="4"><%= upload_column_field ''service_desk_attachment1'', ''attachment'' %></td> </tr> <button type="submit" value="save" >Attach File</button> <%=end_form_tag %> This is not working (the file not uploaded) WHAT I GET ON THE CONTROLLER IS AS A RESULT OF puts params[:service_desk_attachment1][:description] puts params[:service_desk_attachment1][:attachment] IS file1 D:\Sijo\file1.txt BUT THE SAME WAS WORKING WITH THE FOLLOWING .ie JUST WHEN IT WAS start_form_tag instead of form_remote_tag as <%= start_form_tag ({:action => ''attach_file'', :id => @sd_ticket.id, :method => ''post''}, :enctype => ''multipart/form-data'')%> THE ABOVE IS WORKING(the file not uploaded), AND I GET IN THE CONTROLLER file1 #<StringIO:0x47cee90> WHY THIS HAPPENS PLEASE HELP Sijo -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
as far as I know, you can''t upload files through an AJAX call. Also, start_form_tag is deprecated, so you shouldn''t use that anymore. Mike On 3/14/08, Sijo Kg <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi > I have a form like > <%= form_remote_tag :url => { :action => ''attach_file'', > :id => @sd_ticket.id }, > :enctype => ''multipart/form-data'' %> > > <table cellpadding="4" cellspacing="0" border="0" width="100%" > class="itiltable2"> > > <tr> > <td width="25%"><%= text_area "service_desk_attachment1", > "description", "cols" => 50, "rows" => 1 %></td> > > <td width="25%" colspan="4"><%= upload_column_field > ''service_desk_attachment1'', ''attachment'' %></td> > > </tr> > <button type="submit" value="save" >Attach File</button> > <%=end_form_tag %> > > This is not working (the file not uploaded) > WHAT I GET ON THE CONTROLLER IS AS A RESULT OF > > puts params[:service_desk_attachment1][:description] > puts params[:service_desk_attachment1][:attachment] IS > > file1 > D:\Sijo\file1.txt > > > BUT THE SAME WAS WORKING WITH THE FOLLOWING .ie JUST WHEN IT WAS > start_form_tag instead of form_remote_tag as > > <%= start_form_tag ({:action => ''attach_file'', :id => @sd_ticket.id, > :method => ''post''}, :enctype => ''multipart/form-data'')%> > > THE ABOVE IS WORKING(the file not uploaded), AND I GET IN THE > CONTROLLER > file1 > #<StringIO:0x47cee90> > > WHY THIS HAPPENS > PLEASE HELP > Sijo > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, Mar 14, 2008 at 12:50 PM, Mike Garey <random52k-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > as far as I know, you can''t upload files through an AJAX call. Also, > start_form_tag is deprecated, so you shouldn''t use that anymore. > > Mike > > On 3/14/08, Sijo Kg <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > Hi > > I have a form like > > <%= form_remote_tag :url => { :action => ''attach_file'', > > :id => @sd_ticket.id }, > > :enctype => ''multipart/form-data'' %> > > > > <table cellpadding="4" cellspacing="0" border="0" width="100%" > > class="itiltable2"> > > > > <tr> > > <td width="25%"><%= text_area "service_desk_attachment1", > > "description", "cols" => 50, "rows" => 1 %></td> > > > > <td width="25%" colspan="4"><%= upload_column_field > > ''service_desk_attachment1'', ''attachment'' %></td> > > > > </tr> > > <button type="submit" value="save" >Attach File</button> > > <%=end_form_tag %> > > > > This is not working (the file not uploaded) > > WHAT I GET ON THE CONTROLLER IS AS A RESULT OF > > > > puts params[:service_desk_attachment1][:description] > > puts params[:service_desk_attachment1][:attachment] IS > > > > file1 > > D:\Sijo\file1.txt > > > > > > BUT THE SAME WAS WORKING WITH THE FOLLOWING .ie JUST WHEN IT WAS > > start_form_tag instead of form_remote_tag as > > > > <%= start_form_tag ({:action => ''attach_file'', :id => @sd_ticket.id, > > :method => ''post''}, :enctype => ''multipart/form-data'')%> > > > > THE ABOVE IS WORKING(the file not uploaded), AND I GET IN THE > > CONTROLLER > > file1 > > #<StringIO:0x47cee90> > > > > WHY THIS HAPPENS > > PLEASE HELP > > Sijo > > -- > > Posted via http://www.ruby-forum.com/. > > > > > > > > > > > use form_tag--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
yes, there is way but you have to use the "iframe remoting pattern" to do that This great tutorial was a great help (just a walktrough): http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent maerzbow http://blog.odeley.com On 14 Mrz., 08:20, "Mike Garey" <random...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> as far as I know, you can''t upload files through an AJAX call. Also, > start_form_tag is deprecated, so you shouldn''t use that anymore. > > Mike > > On 3/14/08, Sijo Kg <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > > > Hi > > I have a form like > > <%= form_remote_tag :url => { :action => ''attach_file'', > > :id => @sd_ticket.id }, > > :enctype => ''multipart/form-data'' %> > > > <table cellpadding="4" cellspacing="0" border="0" width="100%" > > class="itiltable2"> > > > <tr> > > <td width="25%"><%= text_area "service_desk_attachment1", > > "description", "cols" => 50, "rows" => 1 %></td> > > > <td width="25%" colspan="4"><%= upload_column_field > > ''service_desk_attachment1'', ''attachment'' %></td> > > > </tr> > > <button type="submit" value="save" >Attach File</button> > > <%=end_form_tag %> > > > This is not working (the file not uploaded) > > WHAT I GET ON THE CONTROLLER IS AS A RESULT OF > > > puts params[:service_desk_attachment1][:description] > > puts params[:service_desk_attachment1][:attachment] IS > > > file1 > > D:\Sijo\file1.txt > > > BUT THE SAME WAS WORKING WITH THE FOLLOWING .ie JUST WHEN IT WAS > > start_form_tag instead of form_remote_tag as > > > <%= start_form_tag ({:action => ''attach_file'', :id => @sd_ticket.id, > > :method => ''post''}, :enctype => ''multipart/form-data'')%> > > > THE ABOVE IS WORKING(the file not uploaded), AND I GET IN THE > > CONTROLLER > > file1 > > #<StringIO:0x47cee90> > > > WHY THIS HAPPENS > > PLEASE HELP > > Sijo > > -- > > Posted viahttp://www.ruby-forum.com/.- Zitierten Text ausblenden - > > - Zitierten Text anzeigen ---~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi And finally I suceeded in the file upload (ajaxway) using responds_to_parent,uploadcolumn with iframe remoting pattern Thanks for your help Sijo -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---