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