Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

File extensions are changing wrongly based on content type #66

Open
madhu131313 opened this issue Nov 26, 2019 · 6 comments
Open

File extensions are changing wrongly based on content type #66

madhu131313 opened this issue Nov 26, 2019 · 6 comments

Comments

@madhu131313
Copy link

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

How can we stop this issue?

@madhu131313 madhu131313 changed the title File extensions are changing based on content type File extensions are changing wrongly based on content type Nov 26, 2019
@madhu131313
Copy link
Author

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

@madhu131313
Copy link
Author

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

@Fernandocgomez
Copy link

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
Copy link

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

@madhu131313
Copy link
Author

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.

@Fernandocgomez
Copy link

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,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants