Object storage test
Deploy / deploy (push) Successful in 2m40s

This commit is contained in:
twotalesanimation
2026-07-16 21:58:06 +02:00
parent 9ad878fb56
commit 3264abb432
3 changed files with 244 additions and 0 deletions
+13
View File
@@ -277,6 +277,19 @@ export async function uploadToHetzner(
return { key };
}
/**
* Generate a presigned URL for streaming a Hetzner object directly in the browser.
* No Content-Disposition header — suitable for <video src="..."> playback.
*/
export async function generateHetznerStreamUrl(
key: string,
expiresIn: number = 3600
): Promise<string> {
const { client, bucket } = await buildHetznerClient();
const command = new GetObjectCommand({ Bucket: bucket, Key: key });
return getSignedUrl(client, command, { expiresIn });
}
/**
* Generate a presigned download URL from Hetzner that forces a file download
* with the original filename preserved via Content-Disposition.