C#: Upload a file

Uploads a file to an existing bucket.

Examples

Upload file

var imagePath = Path.Combine("Assets", "fancy-avatar.png");

await supabase.Storage
  .From("avatars")
  .Upload(imagePath, "fancy-avatar.png", new FileOptions \{ CacheControl = "3600", Upsert = false \});

Upload file with Progress

var imagePath = Path.Combine("Assets", "fancy-avatar.png");

await supabase.Storage
  .From("avatars")
  .Upload(imagePath, "fancy-avatar.png", onProgress: (sender, progress) => Debug.WriteLine($"\{progress\}%"));