For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.

Swift: Upload to a signed URL

Upload a file to a bucket using a signed URL.

Examples

Upload to signed URL

let fileData = Data("Hello World".utf8)

try await supabase.storage
  .from("avatars")
  .uploadToSignedURL(
    path: "folder/avatar1.png",
    token: "your-signed-token",
    data: fileData,
    options: UploadOptions(
      contentType: "text/plain"
    )
  )

Upload file from URL to signed URL

let fileURL = URL(fileURLWithPath: "/path/to/file.txt")

try await supabase.storage
  .from("avatars")
  .uploadToSignedURL(
    path: "folder/avatar1.png",
    token: "your-signed-token",
    fileURL: fileURL,
    options: UploadOptions(
      contentType: "text/plain"
    )
  )