class

ActiveStorage::DiskService

Inherits ActiveStorage::Service < Reference < Object

Constructors

new(root : String, name : String = "Local")
Source

Instance methods

delete(key : String) : Nil
Source
download(key : String) : String
Source
exist?(key : String) : Bool
Source
headers_for_direct_upload(key : String, content_type : String | Nil, content_length : Int64, checksum : String | Nil, filename : String | Nil = nil) : Hash(String, String)

Headers the client must send with the direct-upload request.

Source
path_for(key : String) : String

Public: the DiskController serves files through this (the gem's named_disk_service(key[:service_name]).path_for).

Source
upload(key : String, data : String | Bytes, checksum : String | Nil = nil, content_type : String | Nil = nil) : Nil
Source
url_for_direct_upload(key : String, expires_in : Int32, content_type : String | Nil, content_length : Int64, checksum : String | Nil) : String

Verifier-signed token riding in the URL; DiskController#update verifies it (purpose "blob_token") before writing the file.

Source