Module for working with Shrine.rb and S3-compatible APIs for direct file uploads
{ id : String
, storage : String
, metadata : Metadata
}
Represents an uploaded file. This is what will be returned by upload
on success.
{ size : Basics.Int
, filename : String
, mime_type : String
}
A substructure returned as part of the FileUpload
data.
upload : File -> String -> Task Http.Error FileUpload
Upload a file, using a signing endpoint provided by Shrine.
The signingEndpoint is "/s3/params" by default when Shrine is set up on a Ruby on Rails application, but should be used without the preceding slash here, e.g. "s3/params"
fileUploadDecoder : Json.Decode.Decoder FileUpload
A decoder for building a FileUpload
value from JSON.
This isn't actually used in this module but it's provided for convenience.
metadataDecoder : Json.Decode.Decoder Metadata
A decoder for building a Metadata
value from JSON.
This isn't actually used in this module but it's provided for convenience.