Posting Multipart Forms Over ActiveResource

Hi,

I've been using ActiveResource for my application and I have noticed that I cannot post a file using "create". I tried passing Base64 encoded data, but this takes a very long time for larger files (20+ seconds for a 5 meg file).

I decided I would try using Net:HTTP to do the multipart post manually, which works except for the authenticity token and some of the authentication. It also seemed like I was writing a heck of a lot of code that should be part of ActiveResource.

So my question to all of you is what am I missing? Is there a method I am unaware of? Is there a reason that AR does not include this functionality?

I hope I can find a simple way to do this multipart post. If I can't, I'd like to work with you guys to create the support for this functionality.

Thanks, Nick

Hey Nick,

Even I had this requirement of uploading files using some sort of API, but couldn't really leverage Active Resource. what I used is described here http://rubymerchant.blogspot.com/2008/07/submit-multipart-form-programmatically.html.

I am happy to help you include submitting multipart form data as part of ActiveResource,

Thanks Jatinder

Thanks Jatinder,

That worked great, although I had to handle my authentication differently. Thanks again for your help.

-Nick