Uploading a file with form_remote_tag problem

params[uploaded_file] is not recognised when i try form_remote_tag like

<%= form_remote_tag :url=>{:action => “save_file”} ,:html=>{:multipart
=> true} <%=text_field_tag “name”%>

<%= end_form_tag %>

It works when i do a normal submit like so:

<%= form_tag( {:action => ‘save_file’}, :multipart => true) %>
<%=text_field_tag “name”%>

<%= end_form_tag %>

Any ideas what is wrong?

Thanks in advance

You can’t upload a file through AJAX. It has to do with the fact that JS
can’t access file upload fields directly.

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