gem install httpclient
require 'httpclient'
require 'uri'
# Do multipart file upload with POST
httpreq = HTTPClient.new
File.open("#{filename}") do |file|
body = { 'year' => "#{curyear}", 'tag' => "#{tagname}", 'uploadfile' => file}
res = httpreq.post(URI("#{uri}"), body)
end
No comments:
Post a Comment