0

I tried to upload CSV file in angular 5 using the method stated here: https://stackoverflow.com/a/45442595/6105852

but got the errror "Unsupported ContentType: application/vnd.ms-excel". I will appreciate any help with this.

1
  • 1
    Sounds like an issue with the backend, not with angular... Commented May 22, 2018 at 19:18

1 Answer 1

1

I fixed it by wrapping the csv file in a Blob object as follow:

formData.append('file', new Blob([file], {type: 'text/csv'}), file.name);

And it worked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.