rejetto forum

Software => HFS ~ HTTP File Server => Programmers corner => Topic started by: scaryrawr on October 04, 2012, 07:02:07 PM

Title: Upload file with ruby programmatically
Post by: scaryrawr on October 04, 2012, 07:02:07 PM
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.
Title: Re: Upload file with ruby programmatically
Post by: rejetto on January 05, 2013, 02:19:15 PM
you are just sharing your code, not asking anything, aren't you?