instance method
url_for_direct_upload
Ruby on Rails 7.2.3
Since v5.2.8.1Signature
url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: {})
No documentation comment.
Parameters
-
keyreq -
expires_inkeyreq -
content_typekeyreq -
content_lengthkeyreq -
checksumkeyreq -
custom_metadatakey = {}
Source
# File activestorage/lib/active_storage/service/s3_service.rb, line 83
def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: {})
instrument :url, key: key do |payload|
generated_url = object_for(key).presigned_url :put, expires_in: expires_in.to_i,
content_type: content_type, content_length: content_length, content_md5: checksum,
metadata: custom_metadata, whitelist_headers: ["content-length"], **upload_options
payload[:url] = generated_url
generated_url
end
end
Defined in activestorage/lib/active_storage/service/s3_service.rb line 83
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Service::S3Service