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 example, .gif, .png, .doc and so many. |
audio/* | All sound files. |
video/* | All video files. |
image/* | All image files. |
<media type> | A valid media type according to IANA Media Types (http://www.iana.org/assignments/media-types/media-types.xhtml). For example, application/pdf. |
To specify more than one value, separate the values with a comma, for example, accept="audio/*,video/*,image/*".