let contentType = '';
switch (file.file.type) {
case 'image/png':
contentType = 'image/png';
break;
case 'image/jpeg':
contentType = 'image/jpeg';
break;
case 'image/jpg':
contentType = 'image/jpg';
break;
case 'image/webp':
contentType = 'image/webp';
break;
default:
console.error('Unsupported file type');
continue; // Skip unsupported file types
}
const { data: storagesData, error: storageError } = await supabase.storage
.from('images')
.upload(imgUrl, arrayBuffer, {
upsert: false,
cacheControl: null,
contentType: contentType
});
let contentType = '';
switch (file.file.type) {
case 'image/png':
contentType = 'image/png';
break;
case 'image/jpeg':
contentType = 'image/jpeg';
break;
case 'image/jpg':
contentType = 'image/jpg';
break;
case 'image/webp':
contentType = 'image/webp';
break;
default:
console.error('Unsupported file type');
continue; // Skip unsupported file types
}
const { data: storagesData, error: storageError } = await supabase.storage
.from('images')
.upload(imgUrl, arrayBuffer, {
upsert: false,
cacheControl: null,
contentType: contentType
});