aws-s3 icon indicating copy to clipboard operation
aws-s3 copied to clipboard

File extensions are changing wrongly based on content type

Open madhu131313 opened this issue 5 years ago • 6 comments

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

How can we stop this issue?

madhu131313 avatar Nov 26 '19 08:11 madhu131313

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

madhu131313 avatar Dec 17 '19 05:12 madhu131313

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

madhu131313 avatar Dec 17 '19 05:12 madhu131313

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

Fernandocgomez avatar Dec 30 '19 06:12 Fernandocgomez

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

Fernandocgomez avatar Dec 30 '19 06:12 Fernandocgomez

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.

madhu131313 avatar Dec 31 '19 07:12 madhu131313

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,

Fernandocgomez avatar Dec 31 '19 16:12 Fernandocgomez