anacronw / multer-s3

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

Pass filename to Koa context #87

Closed j closed 6 years ago

j commented 6 years ago

I'm creating a new "key" and want to simply store the file-data after it's stored in S3. Everything works, but nothing gets passed back to the koa context. Anyway of doing this?

j commented 6 years ago

Nvm, got it:

  router.post('/upload', multer.single('file'), async (ctx) => {
    const { key, location } = ctx.req.file;

    // ...
  });