Skip to content

Commit 5701ead

Browse files
committed
refactor: remove unused getDecodedFilename method and simplify filename handling in uploadFileToS3
1 parent 9306665 commit 5701ead

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/upload/upload.service.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ export class UploadService {
4040
)}.s3.amazonaws.com/${key}`;
4141
}
4242

43-
private getDecodedFilename(filename: string) {
44-
return Buffer.from(filename, 'latin1').toString('utf8');
45-
}
46-
4743
async uploadFileToS3({
4844
folderName,
4945
file,
@@ -52,7 +48,7 @@ export class UploadService {
5248
file: FileUpload;
5349
}) {
5450
const key = `${folderName}/${new Date().toISOString()}_${path.basename(
55-
this.getDecodedFilename(file.filename),
51+
file.filename,
5652
)}`.replace(/ /g, '');
5753

5854
const upload = new Upload({

0 commit comments

Comments
 (0)