Register now and start sharing your code snippets.
-->

How to perform a file upload (multipart post) with Ruby

Ruby posted 10 months ago by christian

You have at least three options:

  1. The curb gem
  2. The multipart-post Net:HTTP extension
  3. Calling curl from Ruby with, for example, Open3.
       1  Open3.popen3('curl  <and your parameters>') do |input, output, error|
       2      # do something
       3      end
    
Tagged post, multipart, curl, ruby