PrimeNg 5.0.2 FileUpload does not work with docx/pdf/xlsx file types

UI Components for Angular
Post Reply
y.chuyan@gmail.com
Posts: 1
Joined: 18 Dec 2017, 11:18

18 Dec 2017, 11:26

Hello everybody.

I've added a file uploader to the page and set the next acceptance extensions: pdf, docx and xlsx:

<p-fileUpload multiple="multiple" (onSelect)="selectFilesToUpload($event)" (onClear)="clearFilesToUpload()"
accept="application/pdf, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
maxFileSize="2000000" class="ui-fileupload-buttonbar"
[showUploadButton]="false" cancelLabel="Clear">
</p-fileUpload>

When I launch the application and open the file uploader I see files with these extensions, but I can't upload them, the control returns an error about incorrect file type.

Does anybody have any ideas about this problem?

Thank you.

JACrazy
Posts: 20
Joined: 19 Mar 2018, 17:48

19 Mar 2018, 19:16

Was bugging me why it didn't work. Turns out it is the spaces after the commas that is causing it to not work.

kmiyatake
Posts: 4
Joined: 16 Mar 2018, 08:45

20 Mar 2018, 01:27

Thanks for posting how you fixed this. It helped me figure out why my filters were not working for another component!

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests