Method: ActiveStorage::Service::AzureStorageService#url_for_direct_upload

Defined in:
activestorage/lib/active_storage/service/azure_storage_service.rb

#url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: {}) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'activestorage/lib/active_storage/service/azure_storage_service.rb', line 91

def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: {})
  instrument :url, key: key do |payload|
    generated_url = signer.signed_uri(
      uri_for(key), false,
      service: "b",
      permissions: "rw",
      expiry: format_expiry(expires_in)
    ).to_s

    payload[:url] = generated_url

    generated_url
  end
end