You try to upload a 15MB file to Supabase Storage, but the maximum allowed file size is 10MB. What will be the result?
Think about how storage services handle files that are too large.
Supabase Storage rejects files that exceed the configured maximum size and returns an error immediately.
You have a file input in your frontend and want to upload the selected file to Supabase Storage bucket named 'avatars'. Which code snippet correctly performs this upload?
const file = event.target.files[0]; const { data, error } = await supabase.storage.from('avatars').upload('public/' + file.name, file);
Remember the method chaining and parameters for Supabase Storage upload.
The correct method is supabase.storage.from(bucket).upload(path, file). Option B uses this correctly with a full path including folder and filename.
After uploading user profile pictures to Supabase Storage, you want to ensure only the owner can access their picture. Which approach achieves this?
Think about how to control access at the storage level, not just frontend.
Making the bucket private and using signed URLs ensures only authorized users can access files securely. Other options expose files publicly or rely on weak protections.
You expect users to upload large video files (hundreds of MBs). What architecture pattern helps handle this efficiently and reliably?
Consider scalability and user experience for large files.
Direct uploads with chunking reduce backend load and improve upload reliability and user feedback. Backend uploads for large files can cause delays and resource issues.
You want to upload user files without accidentally overwriting existing files with the same name. Which naming strategy is best?
Think about how to avoid collisions in a shared storage bucket.
Prefixing filenames with unique identifiers like user ID and timestamp ensures uniqueness and prevents overwriting. Other options risk data loss or confusion.
