-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to upload multiple images #8
Comments
Thanks for reporting this issue. Yes, actually I haven't tested yet the use of |
Even when doing multiple posts with singe upload some files end up with 0 bites |
@dimitrius1986 how to repro what you said? I didn't face any problem for single upload |
when you do multiple calls to the endpoint, something like this: |
@susutew & @dimitrius1986 you can try again in this branch https://github.com/ikhsanalatsary/multer-sharp-s3/tree/fix/bumps-version |
I will try this today and give you my feedback. It is a great package. |
Hi @susutew I am using the bumps fix branch and it now creates and resizes images passed in the array. However, it is only using the very last image in the input array and only using that one. For example: I am passing 4 images via Postman. The images created are:
As you can see, all the images are the same. The function is being invoked as multer.instance.array() e.g. uploadStuff.array(...)
|
@ashishchandr70 can you try my fork https://github.com/dimitrius1986/multer-sharp-s3 |
@dimitrius1986 sure will try that as well |
@susutew I see, uploaded successfully but the return is wrong. Isn't it? |
@ikhsanalatsary yes exactly. I was able to modify the size of the multiple images but the images are all the same....but sizes are of course different. This is using the bumps version. |
Hi @dimitrius1986 I tried with your fork. However, all the files are not present. Here is my code snippet for using multer-sharp-s3 And as you can see in the image below, not all sizes are present. Some has sm only, some has original only, some has md only, but not all. Am I doing something wrong? |
Guys @ikhsanalatsary @dimitrius1986 any updates on when you plan to resolve this? |
Hi @ikhsanalatsary what do you suggest I do? The only other option is to pull out this library and write more code for resizing the sharp generated images. |
any update? |
Any Update |
any update? |
@ashishchandr70 , @jpmayorga , @prashanthalpha , @ferdigokdemir I already tried to fix this. please try on this branch https://github.com/ikhsanalatsary/multer-sharp-s3/tree/fix-not-able-to-upload-multiple-images. and don't forget to give me feedback |
@ikhsanalatsary
Uploading 2 files case |
Any update on this? if fixed, when is the release? |
https://developer.aliyun.com/mirror/npm/package/multer-s3-transform This will help you to resolve the issue . please check |
yes I decided to go with multer-s3-transform. works well ! |
Hi,
This lib is very usefull, it would be good to have support to multiple uploads at once.
router.post('/update', isAuthorized, upload.array('images', 20), update);
const upload = multer({
storage: s3Storage({
s3,
ACL: 'public-read',
Bucket: config.awsBucket,
multiple: true,
crop: 'attention',
resize: [
{ suffix: 'xlg', width: 1200 },
{ suffix: 'lg', width: 800, height: 600 },
{ suffix: 'md', width: 500, height: 500 },
{ suffix: 'sm', width: 265, height: 190 },
{ suffix: 'xs', width: 100 },
],
Key(req, file, cb) {
cb(null,
${Buffer.from(file.originalname).toString('base64')}_${Date.now().toString()}
);},
}),
});
Right now if I use this code to upload several images, the first one is uploaded successfully but the rest all are stored with 0 bites.
The text was updated successfully, but these errors were encountered: