```typescript import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3" import { v4 as uuidv4 } from "uuid" const s3Client = new S3Client({ endpoint: process.env.S3_ENDPOINT, region: process.env.S3_REGION, credentials: { accessKeyId: process.env.S3_ACCESS_KEY, secretAccessKey: process.env.S3_SECRET_KEY, }, }) export async function uploadFile(file: File) { const fileKey = `tracks/${uuidv4()}${file.name}` await s3Client.send( new PutObjectCommand({ Bucket: process.env.S3_BUCKET_NAME, Key: fileKey, Body: Buffer.from(await file.arrayBuffer()), }) ) return fileKey } ```