views:

88

answers:

2

I am trying send user profile images from a client to the server using ActiveResource. It looks like ActiveResource doesn't support multi-part.

Is there a gem/plugin that adds Multipart support to ActiveResource? Or any other alternative approach to addressing this issue.

A: 

something like this? http://blog.jatinder.me/2008/07/submit-multipart-form-programmatically.html

andi1492
I am aware of this solution. In this approach, client can not use ActiveResource for multi-part content.
KandadaBoggu
A: 

The best way is not to use multipart, but to embed the file's binary content in your resource's XML, which then goes in the request body.

This is easy to do using ActiveResource

I've created a plugin to do that in Rails 3:

http://github.com/nragaz/encoded_attachment

Nick Ragaz