module Scrivito class CmsRestApi module BlobUploader class << self def upload_file(file) upload_permission = CmsRestApi.get('blobs/upload_permission') fields = upload_permission['fields'].merge({file: file}) # Net/HTTP does not support multipart forms RestClient.post(upload_permission['url'], fields) upload_permission['blob'] end end end end end