Join 3,558 readers in helping fund MetaFilter (Hide)


Rails/Java XML-RPC Filter
September 19, 2007 11:12 AM   Subscribe

Railsfilter: I need to write an addition to an already-existing Rails app to allow it to accept large files (and some trivial metadata) uploaded from a Processing (Java) client I've written. The Rails app already supports this behavior via a web interface. I can see a few of the trees, how do I fit them into the forest and get a pair of working apps?

I think I understand basic XML-RPC, but file uploading seems to be a different beast. There's also the question of XML-RPC vs. SOAP vs. REST -- REST seems to be the de facto Rails standard, but there doesn't seem to be much in the way of Java REST APIs, so I'm looking at XML-RPC as the path of least resistance because of its' support through Action Web Service.

So, the question is, can someone please explain to me how file uploads through XML-RPC work? I've read about multi-part forms, base64 encoding and so forth but I'm not really sure how to put it all together.

The Rails app is using file_column for uploads, if that helps.
posted by Alterscape to Computers & Internet (4 answers total) 2 users marked this as a favorite
 
You want cURL, and to use it to make REST calls.
posted by genghis at 2:43 PM on September 19, 2007


I haven't used cURL before so I'm swimming through the docs right now and trying to get my bearings, but if I'm understanding this correctly, it looks like I'd need to have my app call libcurl, log into my server through sftp/ftp, and push the file up. I don't have the ability to create an unlimited number of user accounts and I'm uncomfortable with the idea of so I'd rather keep authorization running through the Rails app. Or am I completely misunderstanding how libcurl would be used in this context?
posted by Alterscape at 3:26 PM on September 19, 2007


cURL seems weird for using in Java.

Why not just a simple HTTP POST?
posted by rbs at 5:59 PM on September 19, 2007


Well, yeah, since REST is all about HTTP POSTs and GETs anyway. There's a cURL wrapper out there, but you can certainly construct your own HTTP POSTS by hand if that floats your boat.
posted by genghis at 8:06 AM on September 21, 2007


« Older Two hard drives in a row have ...   |  GERDfilter: Is it bad to take ... Newer »
This thread is closed to new comments.