title: sinatra and http PUT
body: <p>suppose i want to use curl to put a file to a webservice this way</p>
  
  <pre><code>curl -v --location --upload-file file.txt http://localhost:4567/upload/filename
  </code></pre>
  
  <p>in sinatra i can do:</p>
  
  <pre><code>#!/usr/bin/env ruby
  
  require 'rubygems'
  require 'sinatra'
  
  put '/upload/:id' do
     #
     # tbd
     #
  end
  </code></pre>
  
  <p>how can i read the streaming file?</p>
  
  <p>more or less i want something like this:
  <a href="http://www.php.net/manual/en/features.file-upload.put-method.php#56985" rel="noreferrer">http://www.php.net/manual/en/features.file-upload.put-method.php#56985</a></p>