[LRUG] AJAX file uploads and content types

Andrew Stewart boss at airbladesoftware.com
Thu Apr 5 00:07:14 PDT 2012


On 4 Apr 2012, at 10:29, Andrew Stewart wrote:
> The basic process is this:
> 
> 1) User submits a 'remote' form with a file input.
> 2) Remotipart's javascript intercepts the form submission, creates an iframe with the form data in it, and posts the iframe's form to the server (with content type text/html).
> 3) A remotipart middleware intervenes in the request to convert the request to text/javascript.
> 4) My controller action saves the image and responds by rendering create.js.erb.
> 
> The problem seems to be at step 3.  To gather more information I added `$stderr.puts "useful info"` etc to the remotipart middleware but I can't find the output in my unicorn logs.

To follow up on this, the problem was solved by a hard restart of Unicorn.  I'm not sure yet why the normal zero-downtime restarts didn't pick up the bundled remotipart gem with its middleware, given that other code introduced at the same time was being served by the web processes, but I'm going to take that up on the Unicorn list.

Thanks everybody for the suggestions.

Cheers,

Andy Stewart
----
http://airbladesoftware.com


More information about the Chat mailing list