instance method service_url_for_direct_upload

Ruby on Rails 7.1.6

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

service_url_for_direct_upload(expires_in: ActiveStorage.service_urls_expire_in)

Returns a URL that can be used to directly upload a file for this blob on the service. This URL is intended to be short-lived for security and only generated on-demand by the client-side JavaScript responsible for doing the uploading.

Parameters

expires_in key = ActiveStorage.service_urls_expire_in
Source
# File activestorage/app/models/active_storage/blob.rb, line 222
  def service_url_for_direct_upload(expires_in: ActiveStorage.service_urls_expire_in)
    service.url_for_direct_upload key, expires_in: expires_in, content_type: content_type, content_length: byte_size, checksum: checksum, custom_metadata: custom_metadata
  end

Defined in activestorage/app/models/active_storage/blob.rb line 222 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveStorage::Blob

Type at least 2 characters to search.

↑↓ navigate · open · esc close