uploading multiple files

How would one go about uploading multiple files to a bucket?
2 Replies
garyaustin
garyaustin3y ago
You need to loop and load each file thru the API.
((()))
((()))OP3y ago
like that?
for (file of files) {
const { data, error } = await supabase
.storage
.from('avatars')
.upload(file.name, file);
if (error) throw error;
}
for (file of files) {
const { data, error } = await supabase
.storage
.from('avatars')
.upload(file.name, file);
if (error) throw error;
}

Did you find this page helpful?