Uploadex v2.0.0 Uploadex.FileStorage View Source

Storage for Local Files.

Opts

  • directory: String (required for all functions) - Relative to base_path
  • base_path: String (required for all functions)
  • base_url: String (required for Uploadex.Storage.get_url/2)

To build the URL, base_path will be replaced by base_url.

Example

To use this storage for your User record, define these functions in your Uploadex.Uploader implementation:

def default_opts(Uploadex.FileStorage), do: [base_path: :code.priv_dir(:my_app), base_url: Endpoint.url()]

def storage(%User{} = user), do: {Uploadex.FileStorage, directory: "/uploads/users"}

Link to this section Summary

Link to this section Functions

Link to this function

delete_file_after_delay(delay, path)

View Source