anacronw / multer-s3

multer storage engine for amazon s3
MIT License
660 stars 190 forks source link

`req.file.key` Property Not Available When Using `multer-s3` with typescript #212

Closed DavidQuartz closed 9 months ago

DavidQuartz commented 9 months ago

Description

I am currently encountering an issue where the req.file.key property, which used to provide the file path of an uploaded file in S3, is no longer available in the req.file object when using multer-s3. This issue is causing difficulties in accessing the file path of uploaded files in my application.

Steps to Reproduce

  1. Set up multer-s3 for file uploading in a Node.js application with typescript.
  2. Install @types/multer-s3 since there is not inbuilt typescript support
  3. Try to access req.file.key in a file upload route handler.

Expected Behavior

The req.file object should contain the key property, which holds the path of the uploaded file in the S3 bucket.

Actual Behavior

The req.file.key property is not present in the req.file object. Other properties such as location are available, but key is missing.

Environment

Is this a problem from the type definition file?

DavidQuartz commented 9 months ago

I had the type definition packages as dev dependencies which were ignored by my Dockerfile. It was my own mistake!