Fausto95/aws-s3

File extensions are changing wrongly based on content type

madhu131313 opened this issue · 6 comments

.doc is getting changed to .msword and sometimes .document
.svg is getting changed to .svg+xml

How can we stop this issue?

Please use file.name for getting extension.
const fileExtension: string = file.name.split(".")[1] ; //file.type.split('/')[1];

I have created another npm package https://www.npmjs.com/package/aws-s3-pro as our project needs a quick fix for the above issue

I am still having the same issue even when I installed the new version.

Can you tell us how to fix this with the new update?

Thanks

Please use file.name for getting extension.
const fileExtension: string = file.name.split(".")[1] ; //file.type.split('/')[1];

Also, I don't understand this fix here. If you don't mind can you explain it in more detail? Thank :D

I have edited the source here
https://github.com/Fausto95/aws-s3/blob/master/src/S3Client.ts#L18
as mentioned above to fix that. Try installing aws-s3-pro, it will be fixed.
Else run a build from the changed source and use the build.

Can you tell me what's wrong in using aws-s3-pro because I have installed and working fine.

Hello man!

Thank you so much for taking the time to explain that to me.

I found out that I was still using the old version (aws-s3) and not the new one (aws-s3-pro)

Everything works fine.

Thank you again,