diff --git a/src/cloud/occi/lib/occi-server.rb b/src/cloud/occi/lib/occi-server.rb index e1e1df568d..cfadd287a2 100755 --- a/src/cloud/occi/lib/occi-server.rb +++ b/src/cloud/occi/lib/occi-server.rb @@ -50,6 +50,7 @@ require 'sinatra' require 'yaml' require 'erb' require 'tempfile' +require 'fileutils' require 'json' require 'OCCIServer' @@ -349,9 +350,8 @@ end post '/ui/upload' do file = Tempfile.new('uploaded_image') + FileUtils.cp(request.env['rack.input'].path,file.path) request.params['file'] = file.path #so we can re-use occi post_storage() - file.write(request.env['rack.input'].read) - #file.close # this would allow that file is garbage-collected result,rc = @occi_server.post_storage(request) treat_response(result,rc) end