diff options
author | Christoph Helma <helma@in-silico.ch> | 2012-06-14 11:25:44 +0000 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2012-06-14 11:25:44 +0000 |
commit | 31d0081654ba1593dfd56051b5d14f67541307c4 (patch) | |
tree | 192062aac378b7ec2245a5cb3d84775b9a983279 | |
parent | ca0ac867535d38c0f6e59332b85c8da6f23f372d (diff) |
multipart file uploads enabled
-rw-r--r-- | lib/opentox.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb index 31a6e82..2c4f0ba 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -64,6 +64,10 @@ module OpenTox # Create a new resource post "/#{SERVICE}/?" do uri = uri("/#{SERVICE}/#{SecureRandom.uuid}") + if @content_type =~ /multipart/ + @body = params[:file][:tempfile].read + @content_type = params[:file][:type] + end FourStore.put(uri, @body, @content_type) response['Content-Type'] = "text/uri-list" uri |