p-fileUpload: Specify "Accept" File Types is particular about spacing...

UI Components for Angular
Post Reply
Primaryw
Posts: 25
Joined: 09 Nov 2017, 17:51

16 Nov 2017, 21:51

Just something I noted while working with this module...

The P-fileUpload attribute "accept" will take multiple entries, but any spaces between them will cause failures.

Example: FAILS due to extra white-space after the commas in the values for "accept"

Code: Select all

<p-fileUpload 
name="myfile[]" 
accept=".csv, .xml, .tsv" 
showUploadButton="false" 
showCancelButton="false" 
url="./upload.php"></p-fileUpload>
Example: Works!! Whitespace removed.

Code: Select all

<p-fileUpload 
name="myfile[]" 
accept=".csv,.xml,.tsv" 
showUploadButton="false" 
showCancelButton="false" 
url="./upload.php"></p-fileUpload>
Hope this helps someone.

Mc128k
Posts: 4
Joined: 08 Jan 2018, 00:21

03 Jul 2018, 14:16

Yes, that helped, and it should REALLY be written in the docs.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests