Class: ActiveStorage::DirectUploadsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- ActiveStorage::DirectUploadsController
- Includes:
- DirectUploadToken
- Defined in:
- 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 included from DirectUploadToken
ActiveStorage::DirectUploadToken::DIRECT_UPLOAD_TOKEN_LENGTH, ActiveStorage::DirectUploadToken::SEPARATOR
Constants included from Streaming
Streaming::DEFAULT_BLOB_STREAMING_DISPOSITION
Instance Method Summary collapse
Methods included from DirectUploadToken
#generate_direct_upload_token, #verify_direct_upload_token
Instance Method Details
#create ⇒ Object
9 10 11 12 |
# File 'app/controllers/active_storage/direct_uploads_controller.rb', line 9 def create blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_args.merge(service_name: verified_service_name)) render json: direct_upload_json(blob) end |