Bow v0.3.3 Bow View Source

Bow - the file uploader

Global Configuration

config :bow,
  storage: Bow.Storage.Local,             # storage adapter; Bow.Storage.Local or Bow.Storage.S3
  storage_prefix: "priv/static/uploads",  # storage directory prefix

  store_timeout:  30_000,                 # single version upload timeout
  exec_timeout:   15_000,                 # single command execution timeout

Link to this section Summary

Functions

Delete all versions of given file

Load given file

Regenerate file using different uploader

Process & store given file with its uploader

Link to this section Types

Link to this type

t()

View Source
t() :: %Bow{
  ext: String.t(),
  name: String.t(),
  path: String.t() | nil,
  rootname: String.t(),
  scope: any(),
  uploader: atom()
}

Link to this section Functions

Link to this function

copy(src, dst, opts \\ [])

View Source
copy(src :: t(), dst :: t(), opts()) :: {:ok, map()} | {:error, any()}

Copy file

Link to this function

delete(file, opts \\ [])

View Source
delete(t(), opts()) :: :ok

Delete all versions of given file

Link to this function

load(file, opts \\ [])

View Source
load(t(), opts()) :: {:ok, t()} | {:error, any()}

Load given file

Link to this function

regenerate(file)

View Source
regenerate(t()) :: {:ok, map()} | {:error, any()}

Regenerate file using different uploader

Link to this function

set(file, key, name)

View Source
set(t(), atom(), any()) :: t()
Link to this function

store(file, opts \\ [])

View Source
store(t(), opts()) :: {:ok, map()} | {:error, map()}

Process & store given file with its uploader

Link to this function

url(file)

View Source
url(t() | nil) :: String.t() | nil
Link to this function

url(file, opts)

View Source
url(t() | nil, atom() | list()) :: String.t() | nil
Link to this function

url(file, version, opts)

View Source
url(t() | nil, atom(), list()) :: String.t() | nil