# Fil v0.2.0 - Table of Contents

> Fil is a pluggable file storage abstraction for Elixir.

## Guides

- [Tour](tour.md)
- [Installation](installation.md)
- [Plugins](plugins.md)
- [Phoenix](phoenix.md)
- [Changelog](changelog.md)

## Modules

- [Fil](Fil.md): Fil is a pluggable file storage abstraction for Elixir.
- [Fil.Disk](Fil.Disk.md): A disk is a plain value that describes where files are stored.
- [Fil.Op](Fil.Op.md): One call to a `Fil` function, as plugins see it.
- [Fil.Ref](Fil.Ref.md): A reference to a file on a disk: a `Fil.Disk` plus a path. It can point to a file that doesn't exist yet, such as the
destination of a copy.
- [Fil.Stat](Fil.Stat.md): Metadata about a file or directory.
- [Fil.Telemetry](Fil.Telemetry.md): The [Telemetry](https://hexdocs.pm/telemetry) events `Fil` emits: one span for every operation on every disk, and one
for every read of a stream from `Fil.stream/3`.
- [Fil.Tmp](Fil.Tmp.md): Temporary files and directories, which are removed when the process that created them exits.

- Adapters
  - [Fil.Adapter](Fil.Adapter.md): The contract every adapter implements.
  - [Fil.Adapter.Local](Fil.Adapter.Local.md): The local filesystem, jailed under a root directory.
  - [Fil.Adapter.Memory](Fil.Adapter.Memory.md): Files in memory, in a store that belongs to a process. It's meant for tests.
  - [Fil.Adapter.S3](Fil.Adapter.S3.md): Amazon S3 and services that implement its API, such as [RustFS](https://github.com/rustfs/rustfs),
[SeaweedFS](https://github.com/seaweedfs/seaweedfs), [Adobe S3Mock](https://github.com/adobe/S3Mock),
[Cloudflare R2](https://developers.cloudflare.com/r2/), [Backblaze B2](https://www.backblaze.com/cloud-storage),
[Tigris](https://www.tigrisdata.com) and [Ceph](https://ceph.io).

- Plugins
  - [Fil.Plugin.ContentType](Fil.Plugin.ContentType.md): Sets the content type of a write from the file extension.
  - [Fil.Plugin.Thumbnails](Fil.Plugin.Thumbnails.md): Writes smaller copies of images next to them, resized with [libvips](https://www.libvips.org).
  - [Fil.Plugin.URL](Fil.Plugin.URL.md): Builds URLs for any disk, served by `Fil.Plug` from your application.
  - [Fil.Plugin.Validation](Fil.Plugin.Validation.md): Refuses writes that break the disk's rules: too large or too small, of a type the disk doesn't take, with the wrong
extension, or anything a check of your own refuses.

- Integrations
  - [Fil.Ecto.Ref](Fil.Ecto.Ref.md): An [Ecto](https://hexdocs.pm/ecto) type for files on a disk. The column holds the path, and loading a record returns
a `Fil.Ref` on the disk the field names
  - [Fil.Kino](Fil.Kino.md): Browses disks in [Livebook](https://livebook.dev), uploads files to them, and adds a smart cell that builds a disk.
  - [Fil.LiveView](Fil.LiveView.md): Stores [Phoenix LiveView](https://hexdocs.pm/phoenix_live_view) uploads on a disk.
  - [Fil.Plug](Fil.Plug.md): Serves the files of a disk over HTTP: the URLs `Fil.Plugin.URL` signs, or with `public: true`, every file.

- Errors
  - [Fil.AccessDeniedError](Fil.AccessDeniedError.md): The storage refused access. Fix the permissions or the credentials.
  - [Fil.AlreadyExistsError](Fil.AlreadyExistsError.md): A write, a copy or a move with `if_exists: :error` found a file already there. Read that file and decide again.
  - [Fil.ChecksumMismatchError](Fil.ChecksumMismatchError.md): The content doesn't match its checksum. Upload or download it again.
  - [Fil.ConfigurationError](Fil.ConfigurationError.md): The disk's options don't match the storage. Fix the disk's options.
  - [Fil.ConflictError](Fil.ConflictError.md): The file changed while the operation used it. Read it again and retry.
  - [Fil.InvalidContentError](Fil.InvalidContentError.md): A plugin refused the content. Send other content.
  - [Fil.InvalidRequestError](Fil.InvalidRequestError.md): The path or the content can't be used here. Use another path or smaller content.
  - [Fil.NotFoundError](Fil.NotFoundError.md): The file doesn't exist. Treat it as missing.
  - [Fil.StorageFullError](Fil.StorageFullError.md): There's no space left, or a quota is used up. Free up space or raise the quota.
  - [Fil.UnavailableError](Fil.UnavailableError.md): The storage didn't answer, or asked to wait. Try again later.
  - [Fil.UnknownError](Fil.UnknownError.md): The storage reported something no other error describes. Log it and fail.
  - [Fil.UnsupportedError](Fil.UnsupportedError.md): The disk can't do this operation. Attach a plugin or use another disk.

