0

I'm using Uploadify with Rails 3. The form works on every browser except IE.

I properly set my csrf variables so that the session isn't completely blown away.

<% key = Rails.application.config.session_options[:key] %>
var uploadify_script_data = {};
var csrf_param = $('meta[name=csrf-param]').attr('content');
var csrf_token = $('meta[name=csrf-token]').attr('content');

uploadify_script_data[csrf_param] = encodeURI(encodeURIComponent(csrf_token));
uploadify_script_data['<%= key %>'] = encodeURI(encodeURIComponent('<%= cookies[key] %>'));

$('#uploadify').uploadify({
  ...
  scriptData      : uploadify_script_data,
  ...
});

The issue comes up when I'm working with a 3 step form. In the second step I save the needed params to a session variable. In all the steps I merge the params with the session variable to keep it up to date.

In the second step it looks like the session is just fine (I print it out to the log and all the information is there), but this is also the step I use uploadify. In the controller that handles the ajax call, I print out the session and I can see the session id and devise information, but my object_params that I'm working with is completely reset to be an empty hash.

This is from the controller that handles the uploader:

{"session_id"=>"fa12222657a979c92daf1a04dcec7fa8", "_csrf_token"=>"YCN8BvE8+6Vxc2PWgpOvZBhYufKdsTfEnJVkbTSdWHI=", "warden.user.user.key"=>["User", [20], "$2a$10$JCkVLxybPQYclyp2t1gnpu"], "object_params"=>{}}

Again, this only happens in IE8 and IE9.

Any ideas on how to debug this?

Additional resources:
Rails Carrier Wave with JQuery Uploader

Community
  • 1
  • 1
RyanJM
  • 7,028
  • 8
  • 60
  • 90

1 Answers1

0

I had to write this off as an IE issue. Ended up using the standard Uploadify form for IE and my custom image for everything else.

RyanJM
  • 7,028
  • 8
  • 60
  • 90