fix: escape non-ascii characters in filenames in s3 file provider (#14209)

* escape non-ascii characters in filenames in s3 file provider

* fix url encoding
This commit is contained in:
Pedro Guzman
2025-12-04 18:37:56 +01:00
committed by GitHub
parent e3e3c725db
commit b7adfb225b
3 changed files with 25 additions and 3 deletions
@@ -148,7 +148,7 @@ export class S3FileService extends AbstractFileProviderService {
// Note: We could potentially set the content disposition when uploading,
// but storing the original filename as metadata should suffice.
Metadata: {
"x-amz-meta-original-filename": file.filename,
"original-filename": encodeURIComponent(file.filename),
},
})
@@ -160,7 +160,7 @@ export class S3FileService extends AbstractFileProviderService {
}
return {
url: `${this.config_.fileUrl}/${fileKey}`,
url: `${this.config_.fileUrl}/${encodeURI(fileKey)}`,
key: fileKey,
}
}