FileStorageApi.File behaviour (file_storage_api v0.3.2)
Module for uploading deleting and fetching url of file
Link to this section Summary
Functions
Function to delete files
public_url returns an full url to be able to fetch the file with security tokens needed by default 1 day valid
Function to upload file has input args container_name: name of the container filename: path to the file with the data to store blob_name: how the blob is going to be called after storage
This function will create a temporary file and upload to asset store
Link to this section Types
Specs
Link to this section Functions
delete(container_name, filename)
Specs
Function to delete files
Has 2 inputs container_name: name of container file is stored in filename: reference path of the file stored in the container
last_modified(file)
public_url(container_name, file_path, start_time \\ Timex.now(), expire_time \\ Timex.add(Timex.now(), Timex.Duration.from_days(1)))
Specs
public_url(String.t(), String.t(), DateTime.t(), DateTime.t()) :: {:ok, String.t()} | {:error, String.t()}
public_url returns an full url to be able to fetch the file with security tokens needed by default 1 day valid
sanitize(name)
Specs
upload(container_name, filename, blob_name)
Specs
Function to upload file has input args container_name: name of the container filename: path to the file with the data to store blob_name: how the blob is going to be called after storage
Returns reference to the file in the asset store
upload_file_from_content(filename, container_name, content, blob_name)
Specs
upload_file_from_content(binary(), binary(), binary() | iodata(), binary()) :: {:ok, String.t()} | {:file_upload_error, map()}
This function will create a temporary file and upload to asset store
Link to this section Callbacks
delete(arg1, arg2)
Specs
last_modified(t)
Specs
last_modified(t()) :: {:ok, DateTime.t()} | {:error, atom()}
public_url(arg1, arg2, arg3, arg4)
Specs
public_url(String.t(), String.t(), DateTime.t(), DateTime.t()) :: {:ok, String.t()} | {:error, String.t()}