require 'fiona7/controller_helper' module Fiona7 class UploadsController < ApplicationController def create # TODO: make this code independent from SDK # TODO: nil file uploads upload = params[:file] filename = params[:filename].presence || upload.original_filename obj_id = params[:obj_id] content_type = params[:content_type] future_binary = Scrivito::Binary.upload(upload.open, { filename: filename, content_type: content_type }) blob_spec = Scrivito::CmsRestApi.upload_future_binary(future_binary, obj_id) render json: blob_spec end end end