summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/opentox.rb4
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