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

UI Components for Angular
Post Reply
Primaryw
Posts: 7
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.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests