jeffminsungkim/nestjs-multer-extended

Returning "Key" instead of "key" after Uploading to S3

Closed this issue · 3 comments

Good day everyone, I'm currently experiencing difficulties on using the package right now.
version I'm using: 1.3.1

When uploading large file (maybe 5mb above) it's returning the following data
image

When uploading small file (maybe 5mb below) it's returning the following data
image

If you compare the returned response you'll see difference specially in key (uploading small file return "key" while uploading medium or larger will return "Key" instead.)

this is a code from my controller

interface File {
  readonly mimetype: string;
  readonly Location: string;
  readonly key: string;
  readonly width: number;
  readonly height: number;
  readonly size: number;
}

class UploadUserPhotoDto {
  @ApiProperty({ type: 'string', format: 'binary' })
  readonly file: any;
}

@Post('uploadUserPhoto')
  @ApiBody({ type: UploadUserPhotoDto })
  @ApiConsumes('multipart/form-data')
  @UseInterceptors(AmazonS3FileInterceptor('file', { randomFilename: true }))
  async uploadUserPhoto(@CurrentUser() user: User, @UploadedFile() file: File) {
    return this.photoService.uploadUserPhoto(user, file);
  }
stale commented

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

stale commented

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

I'm still encountering this problem.