File upload problem when using form_remote_tag

Hi
I have a form like
<%= form_remote_tag :url => { :action => ‘attach_file’,
:id => @sd_ticket.id },
:enctype => ‘multipart/form-data’ %>

<td width="25%" colspan="4"><%= upload_column_field

‘service_desk_attachment1’, ‘attachment’ %>

Attach File <%=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

<%= text_area "service_desk_attachment1", "description", "cols" => 50, "rows" => 1 %>

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 Fri, Mar 14, 2008 at 12:50 PM, Mike G. [email protected]
wrote:

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

Hi
And finally I suceeded in the file upload (ajaxway) using
responds_to_parent,uploadcolumn with iframe remoting pattern

Thanks for your help
Sijo

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs