anacronw / multer-s3

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

custom content-type support #8

Closed LinusU closed 8 years ago

LinusU commented 8 years ago

The tests could be a bit more extensive and I haven't added documentation yet, but this does all the heavy lifting.

I've replaced s3fs with the official aws-sdk so this should close #3 as well as #7.

Use it like so:

const multerS3 = require('multer-s3')
const storage = new multerS3({
  ...
  contentType: multerS3.AUTO_CONTENT_TYPE
})

contentType can also be your own function with the signature (req, file, cb).

anacronw commented 8 years ago

Elegant refactor, I expected there'd be more code involved w/ this feature

anacronw commented 8 years ago

Can you add some quick documentation to the README? Everything else looks good to me

anacronw commented 8 years ago

@ch0p57ickz thanks for testing

LinusU commented 8 years ago

Thank you for landing, we should still fix your nits and add documentation though :)

Mobasher-NetLinks commented 5 years ago

How we can use it inside shouldTransform to check if its valid type or no, I mean checking with magic number, I used it inside shouldTransform but it stuck on that point, and not goes to tranform function

thenengah commented 4 years ago

Would be nice to update the docs. Let me know if I can help out!