Key independent system

This commit is contained in:
Sean Morley
2024-06-14 11:04:43 +00:00
parent fc8a162aa9
commit 7894e8c192
8 changed files with 59 additions and 13 deletions

View File

@@ -106,9 +106,11 @@ export async function POST(event: RequestEvent): Promise<Response> {
Buffer.from(fileBuffer)
);
const newKey = objectUrl.split("/").pop() as string;
console.log(`File uploaded to ${objectUrl}`);
return new Response(JSON.stringify({ objectUrl }), {
return new Response(JSON.stringify({ objectUrl, key: newKey }), {
status: 200,
headers: {
"Content-Type": "application/json",