0

I tested the ng2-file-upload on my vm without any office installed, and I am trying to upload a file with a file type of .doc & .docx and it keeps me going to this condition ->

this.uploader.onWhenAddingFileFailed = (item, filter, options) => { }

is there a workaround on this to work without me having to install office at all?

Raniel Quirante
  • 315
  • 2
  • 15

1 Answers1

0

Your OS doesn't have any predefined specific mime type. It doesn't know how to open .docx/.xlsx/.ppt files. These mime types will be added to your OS with special soft.

Browser sets application/octet-stream as mime type of your file

So, your back-end should have two different scenarios on file-upload, where it should check mime type or file extension

Ihor Yanovchyk
  • 768
  • 6
  • 13