Skip to content

Commit

Permalink
fix(be): upload image with original name
Browse files Browse the repository at this point in the history
  • Loading branch information
harisato committed Jul 11, 2023
1 parent 9329f9e commit a352811
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/files/files.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ export class FilesService {
if (!f.mimetype.includes('image')) {
throw Error('file type is not valid');
}
const keyName = `manga-${mangaId}/${f.fieldname}.${f.originalname
.split('.')
.pop()}`;
// const keyName = `manga-${mangaId}/${f.fieldname}.${f.originalname
// .split('.')
// .pop()}`;
const keyName = `manga-${mangaId}/${f.originalname}`;

await this.uploadToS3(keyName, f.buffer);
return new URL(keyName, this.configService.get<string>('aws.queryEndpoint'))
Expand Down

0 comments on commit a352811

Please sign in to comment.