Swift: Upload a file

Examples

Upload file

let fileName = "avatar1.png"

try await supabase.storage
  .from("avatars")
  .upload(
    path: "public/\(fileName)",
    file: fileData,
    options: FileOptions(
      cacheControl: "3600",
      contentType: "image/png",
      upsert: false
    )
  )