ivan-novakov / extjs-upload-widget

File upload widget for ExtJS v4
81 stars 42 forks source link

Using Rails Backend gives an error in the rack middleware (invalid byte sequence in UTF-8) #4

Open rubyprince opened 11 years ago

rubyprince commented 11 years ago

We are trying to use this plugin in our application. We are using Rails on the server side and when the upload request hits the server side, the Rack middleware which parses the request (POST request I guess), is throwing an error invalid byte sequence in UTF-8, in the server side. Any chance it may be due to faulty request made?

ivan-novakov commented 11 years ago

I'm not familiar with the Rails Backend, but I see one possible problem - the backend probably expects a standard POST request as if sent from a form ("application/x-www-form-urlencoded"). However, the plugin sends directly the raw image data in the POST body.

ivan-novakov commented 11 years ago

You may now try the FormDataUploader, which functions as if the file has been uploaded through a form. May be that is what the Rails backend is expecting. See the README for more info.