Skip to content

Commit

Permalink
Fix downloading video files from object storage
Browse files Browse the repository at this point in the history
With title that contains non ISO 8859 characters
  • Loading branch information
Chocobozzz committed Dec 19, 2023
1 parent c72d5ea commit c93b708
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/core/lib/object-storage/pre-signed-urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function generateWebVideoPresignedUrl (options: {
const command = new GetObjectCommand({
Bucket: CONFIG.OBJECT_STORAGE.WEB_VIDEOS.BUCKET_NAME,
Key: buildKey(key, CONFIG.OBJECT_STORAGE.WEB_VIDEOS),
ResponseContentDisposition: `attachment; filename=${downloadFilename}`
ResponseContentDisposition: `attachment; filename=${encodeURI(downloadFilename)}`
})

const url = await getSignedUrl(await getClient(), command, { expiresIn: 3600 * 24 })
Expand All @@ -41,7 +41,7 @@ export async function generateHLSFilePresignedUrl (options: {
const command = new GetObjectCommand({
Bucket: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS.BUCKET_NAME,
Key: buildKey(key, CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS),
ResponseContentDisposition: `attachment; filename=${downloadFilename}`
ResponseContentDisposition: `attachment; filename=${encodeURI(downloadFilename)}`
})

const url = await getSignedUrl(await getClient(), command, { expiresIn: 3600 * 24 })
Expand Down

0 comments on commit c93b708

Please sign in to comment.