So... I was trying to figure this out all day, and I finally got it to work nicely.
gem install curb
require 'curb'
c = Curl::Easy.new('
http://server/uploadpath')
c.multipart_form_post = true
c.http_post(Curl::PostField.file('fileupload1', '/path/to/file'), Curl::PostField.content('upbtn', 'Upload files'))
Since curl has other language bindings it should be similar for those too.