Class: ActiveStorage::DirectUploadsController

Inherits:
BaseController show all
Defined in:
activestorage/app/controllers/active_storage/direct_uploads_controller.rb

Overview

Creates a new blob on the server side in anticipation of a direct-to-service upload from the client side. When the client-side upload is completed, the signed_blob_id can be submitted as part of the form to reference the blob that was created up front.

Constant Summary

Constants inherited from ActionController::Base

ActionController::Base::MODULES, ActionController::Base::PROTECTED_IVARS

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

#append_features, #class_methods, extended, #included, #prepend_features, #prepended

Methods inherited from ActionController::Base

without_modules

Methods inherited from ActionController::Metal

action, action_encoding_template, controller_name, #controller_name, dispatch, #dispatch, #headers, #initialize, make_response!, middleware, #params, #params=, #performed?, #request, #reset_session, #response, #response=, #response_body=, #session, #set_request!, #set_response!, #to_a, #url_for, use

Methods included from ActionController::Testing::Functional

#clear_instance_variables_between_requests, #recycle!

Methods inherited from AbstractController::Base

abstract!, action_methods, #action_methods, #action_name, #available_action?, clear_action_methods!, controller_path, #controller_path, eager_load!, #formats, inherited, #inspect, internal_methods, method_added, #performed?, #process, #response_body, supports_path?

Methods included from ActiveSupport::DescendantsTracker

clear, #descendants, descendants, disable_clear!, reject!, store_inherited, subclasses, #subclasses

Methods included from ActiveSupport::Configurable

#config

Constructor Details

This class inherits a constructor from ActionController::Metal

Instance Method Details

#createObject



7
8
9
10
# File 'activestorage/app/controllers/active_storage/direct_uploads_controller.rb', line 7

def create
  blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_args)
  render json: direct_upload_json(blob)
end