Supabase.Storage.FileOptions (supabase_storage v0.4.2)

Represents the configurable options for an File within Supabase Storage.

This module encapsulates options that can be set or modified for a storage object. These options help in controlling behavior such as caching, content type, and whether to upsert an object.

Summary

Types

t()

An FileOptions consists of the following attributes

Types

t()

@type t() :: %Supabase.Storage.FileOptions{
  cache_control: String.t(),
  content_type: String.t(),
  headers: map(),
  metadata: map(),
  upsert: boolean()
}

An FileOptions consists of the following attributes:

  • cache_control: The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the Cache-Control: max-age=<seconds> header. Defaults to 3600 seconds.
  • content_type: Specifies the media type of the resource or data. Default is "text/plain;charset=UTF-8".
  • upsert: When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false.
  • metadata: The metadata option is an object that allows you to store additional information about the file. This information can be used to filter and search for files. The metadata object can contain any key-value pairs you want to store.
  • headers: Optionally add extra headers to the request.

Functions

parse(attrs)

@spec parse(map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}