exfile v0.2.2 Exfile.Ecto.File
An Ecto.Type
used to handle files persisted to the
store
backend.
Summary
Functions
Casts a recognizable value to an %Exfile.File{}
and uploads it to the
backend if necessary
Dumps an %Exfile.File{}
struct to the file ID, suitable for storage in
the database
Loads a file ID from the database and returns an %Exfile.File{}
struct
representing that file
The Ecto type
Functions
Casts a recognizable value to an %Exfile.File{}
and uploads it to the
backend if necessary.
Accepts four patterns:
- Another
%Exfile.File{}
- An
%Exfile.LocalFile{}
- A
%Plug.Upload{}
- A string URI representing a file from an arbitrary backend
The string URI can be used to upload a file that is currently stored in a separate backend. The format is:
exfile://[backend name]/[file ID]
Loads a file ID from the database and returns an %Exfile.File{}
struct
representing that file.