Complete the code to upload a file to Supabase Storage.
const { data, error } = await supabase.storage.from('avatars').upload([1], file);The first argument is the file path in the storage bucket, like 'profile.png'.
Complete the code to specify the storage bucket when uploading a file.
const { data, error } = await supabase.storage.from([1]).upload('profile.png', file);The bucket name must match the storage bucket you want to upload to, like 'avatars'.
Fix the error in the upload method call to correctly handle file uploads.
const { data, error } = await supabase.storage.from('avatars').upload('profile.png', [1]);The second argument must be the file object to upload, not a string or null.
Fill both blanks to set the correct bucket and file path for uploading.
const { data, error } = await supabase.storage.from([1]).upload([2], file);The bucket is 'avatars' and the file path is 'profile.png' to upload the file correctly.
Fill all three blanks to upload a file and handle the response correctly.
const { data, error } = await supabase.storage.from([1]).upload([2], [3]);
if (error) {
console.error(error.message);
}Use 'avatars' as the bucket, 'profile.png' as the file path, and the file object to upload. Then check for errors.
