Sha256: 1684c033272bc0d5b7f8549d917b9f20e653d4a03c88108b58537dffdc5a5399

Contents?: true

Size: 664 Bytes

Versions: 3

Compression:

Stored size: 664 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.5 app/controllers/fiona7/uploads_controller.rb
infopark_fiona7-1.6.1.1.1 app/controllers/fiona7/uploads_controller.rb
infopark_fiona7-1.6.1.1.0 app/controllers/fiona7/uploads_controller.rb