anacronw / multer-s3

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

TS: contentDisposition does not exist in type 'Options' #144

Closed DavideViolante closed 3 years ago

DavideViolante commented 3 years ago
storage: multerS3({
    s3: s3,
    bucket: `mybucket`,
    acl: 'public-read',
    contentDisposition: 'attachment', // <= this property shows an error in TypeScript
    contentType: (req, file, cb) => {
      cb(null, 'application/pdf');
    },
    key: (req, file, cb) => {
      cb(null, file.originalname);
    },
  }),

Error shows at that line:

Argument of type '{ s3: S3; bucket: string; acl: string; contentDisposition: string; contentType: (req: Request, file: File, cb: (error: any, mime?: string, stream?: ReadableStream) => void) => void; key: (req: Request, file: File, cb: (error: any, key?: string) => void) => void; }' is not assignable to parameter of type 'Options'.
  Object literal may only specify known properties, and 'contentDisposition' does not exist in type 'Options'.ts(2345)
DavideViolante commented 3 years ago

Fixed in the PR above.