views:

185

answers:

1

I have a Rails application setup to receive file attachments using Paperclip.

Now I need to allow a .net/C# cell phone application to post files along with the XML in the same way (or some other way if necessary: they could encode the image as base64 and send - they tried that initially - including the binary data in the tag that would normally be a file field in the web application, but it did not work.

I have found nothing in the way of documentation and wondering if anybody has experience or advice.

A: 

Surprising that there is apparently no documentation for doing this anywhere to be found. I ended up stumbling across a document on the Basecamp website describing how their file attachment process works for API users and used it as a guideline.

http://developer.37signals.com/basecamp/

with help from this article about posting files:

http://www.codevil.com/index.php/2009/05/23/posting-and-getting-files-in-rubyrails/

I modified my initial setup so that, rather than passing the tag in the XML, they first post a file and receive an file ID in response.

Then they post the XML with that reference and their .

Then I use before_validation and after_save callbacks to set the file with Paperclip, and remove the tmp file after the save.

Gordon Isnor
There is plenty of documentation around and its a common thing that many people could have helped you with but your question wasnt very well written. Next time try to break down your question a bit more so people can help. Saying things like "it did not work" doesnt give us any insight into why not
ADAM