Skip to content
/ filex Public

Elixir wrapper for file.io's ephemeral file upload API πŸ—ƒ

License

Notifications You must be signed in to change notification settings

fteem/filex

Repository files navigation

Filex

A Elixir library that wraps file.io's API, allowing ephemeral file sharing/uploads via your Elixir apps.

Installation

The package can be installed by adding filex to your list of dependencies in mix.exs:

def deps do
  [
    {:filex, git: "https://github.com/fteem/filex", tag: "0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/filex.

Usage

Filex has two available functions: Filex.upload/1 and Filex.upload/3:

Filex.upload/3 takes a file_path, an amount and a period as arguments. A period can be :week, :month or :year, while amount is an int expressing the amount of periods:

iex> Filex.upload("/path/to/file.txt", 2, :week)
{ :ok, [url: "https://file.io/UiHJKe", expires: "14 days"]}

iex> Filex.upload("/path/to/file.txt", 3, :month)
{ :ok, [url: "https://file.io/XRpTyW", expires: "90 days"]}

iex> Filex.upload("/path/to/file.txt", 1, :year)
{ :ok, [url: "https://file.io/OLbXRq", expires: "365 days"]}

Filex.upload/1 is an alias for Filex.upload(file_path, 1, :week):

iex> Filex.upload("/path/to/file.txt")
{ :ok, [url: "https://file.io/aQbnDJ", expires: "7 days"]}

License

This project is licensed under the MIT License. See LICENSE.

About

Elixir wrapper for file.io's ephemeral file upload API πŸ—ƒ

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages