July 2017
Intermediate to advanced
384 pages
8h 23m
English
By default, any file types can be uploaded. The file size is not limited either. You can restrict file types and size by setting the accept and maxFileSize options, respectively:
<p-fileUpload name="demofiles[]" url="http://localhost:3004/ fake-backend" multiple="true" accept="image/*" maxFileSize="50000"></p-fileUpload>
In the example, only images with the maximum size 50000 bytes may be uploaded. Violation of those rules causes validation messages to appear in the content section.

Possible values of the accept property:
| Value | Description |
| <file extension> | A file extension starting with dot, for ... |
Read now
Unlock full access