multer-sharp-s3
multer-sharp-s3 copied to clipboard
Metadata and Content-Disposition
Will this library support Metadata and Content-Disposition?
I've tried adding Content-Disposition like this:
var upload = multer({
storage: multerS3({
s3: s3,
Bucket: s3Bucket,
ContentType: multerS3.AUTO_CONTENT_TYPE,
ContentDisposition: 'attachment',
Key: (req, file, cb) => {
cb(null, file.originalname);
}
}),
fileFilter: mediaFilter
});
but in my S3 bucket, the metadata Content-Disposition does not get added.
S3 Upload Property has Content-Disposition as one of its properties.
Looking forward to this.
How did you guys used the AUTO_CONTENT_TYPE from 'multer-s3', i can't get it done correctly, ContentType is throwing a typescript error and when i silence it, it throws this error "Expected params.ContentType to be a string"
How did you guys used the AUTO_CONTENT_TYPE from 'multer-s3', i can't get it done correctly, ContentType is throwing a typescript error and when i silence it, it throws this error "Expected params.ContentType to be a string"
Sorry, when I tested this further. I got the same error as you. AUTO_CONTENT_TYPE is not implemented in multer-sharp-s3 so there's no hope of getting that working. Did you ever find a fix for this?
Unfortunately not, I just abandoned both of multer-s3 and multer-sharp-s3 and I just used raw aws-sdk with sharp and it's even better.
Unfortunately not, I just abandoned both of multer-s3 and multer-sharp-s3 and I just used raw aws-sdk with sharp and it's even better.
Yup, that's what I did do. AWS sdk on its own with Sharp seems to work a lot better.
Hi @KevinLu, thanks for addressing this issue. for contentType
, this lib has a default value if you don't specify it will check based on your file type. for the ContentDisposition
, this lib not supported it yet. I will check if I have spare time.
Hi @KevinLu, thanks for addressing this issue. for
contentType
, this lib has a default value if you don't specify it will check based on your file type. for theContentDisposition
, this lib not supported it yet. I will check if I have spare time.
Thanks for the response, let me know if you've gotten it sorted out. I'd love to give this package another try.
@rramiachraf @KevinLu Can you guys share an example code? I'd like to go with aws-sdk and sharp too. Since this package is not maintained anymore.
@ozgrozer here you go man, https://github.com/rramiachraf/buffalo/blob/main/backend/src/rest/updatePoster.ts
@rramiachraf Thank you for the code. It helped me a lot.
I also made a clean version of it and posted to Stack Overflow. Thought it might help other people who are struggling with the same issue.
https://stackoverflow.com/a/70114704/1340552
Thank you for addressing this issue. I think there's a missing in this lib 😃 . If you don't mind and can fix this. PR is always welcome. FYI, I just published v.0.2.2.