You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Notice]: v2.0.0 renames this package from storage-csharp to Supabase.Storage. The depreciation notice has been set in NuGet. The API remains the same.
Examples (using supabase-csharp)
publicasyncvoidMain(){// Make sure you set these (or similar)varurl=Environment.GetEnvironmentVariable("SUPABASE_URL");varkey=Environment.GetEnvironmentVariable("SUPABASE_KEY");awaitSupabase.Client.InitializeAsync(url,key);// The Supabase Instance can be accessed at any time using:// Supabase.Client.Instance {.Realtime|.Auth|etc.}// For ease of readability we'll use this:varinstance=Supabase.Client.Instance;// Interact with Supabase Storagevarstorage=Supabase.Client.Instance.Storageawait storage.CreateBucket("testing")var bucket =storage.From("testing");
var basePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Replace("file:", "");varimagePath=Path.Combine(basePath,"Assets","supabase-csharp.png");awaitbucket.Upload(imagePath,"supabase-csharp.png");// If bucket is public, get urlbucket.GetPublicUrl("supabase-csharp.png");// If bucket is private, generate urlawaitbucket.CreateSignedUrl("supabase-csharp.png",3600));// Download it!awaitbucket.Download("supabase-csharp.png",Path.Combine(basePath,"testing-download.png"));}