Bow (Bow v0.4.3) 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

Specs

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

Specs

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

Copy file

Link to this function

delete(file, opts \\ [])

View Source

Specs

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

Delete all versions of given file

Specs

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

Load given file

Specs

new(keyword()) :: t()

Specs

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

Regenerate file using different uploader

Specs

set(t(), atom(), any()) :: t()

Specs

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

Process & store given file with its uploader

Specs

url(t() | nil) :: String.t() | nil

Specs

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

url(file, version, opts)

View Source

Specs

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