@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user