Primeng: [Bug] in FileUpload Component

Created on 20 Apr 2017  路  4Comments  路  Source: primefaces/primeng

The problem is that the method isFileTypeValid is implemented in a very weird way on the component.

For the details, please see my comment on this issue:
https://github.com/primefaces/primeng/issues/1694#issuecomment-294793171

defect

Most helpful comment

It's definitely broken. When I use application/pdf it marks every file as invalid (even pdf files).

All 4 comments

Hi,
I think it should be something like that:
var acceptable = this.isWildcard(type) ? this.getTypeClass(file.type) === this.getTypeClass(type) : file.type === type;

It's definitely broken. When I use application/pdf it marks every file as invalid (even pdf files).

This should be fixed in recent PrimeNG release, please try with it and if the issue persists drop a comment with along with a test case based on plunkr below and we'll review again.

http://plnkr.co/edit/Wj39h1?p=preview

anyone find a fix?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cyberrranger picture cyberrranger  路  3Comments

Faigjaz picture Faigjaz  路  3Comments

philly-vanilly picture philly-vanilly  路  3Comments

Helayxa picture Helayxa  路  3Comments

Helayxa picture Helayxa  路  3Comments