Spaces:
Sleeping
Sleeping
File size: 410 Bytes
50a7502 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import { supabase } from '../config/supabaseClient.js';
export const uploadFile = async (file: File | Buffer, bucketName: string, fileName: string, fileType: string) => {
const { data, error } = await supabase.storage
.from(bucketName)
.upload(fileName, file, {
contentType: fileType
});
if (error) {
console.error(error);
return null;
}
return data.id;
} |