Attributes · accept
Which attributes work with accept?
capture and multiple change the picker; the form's enctype decides whether the file is sent at all.
| Attribute | What it does | Docs |
|---|---|---|
accept | A comma-separated list of MIME types (application/pdf), wildcards (image/*, audio/*, video/*) or extensions starting with a dot (.pdf). It filters the file picker only. | MDN |
capture | On phones, with an image or video accept, opens the camera directly: user for the front camera, environment for the rear. Desktop browsers ignore it. | MDN |
multiple | Lets the user pick several files. accept applies to each one. | MDN |
required | Blocks the submit until a file is chosen. It does not check the file's type. | MDN |
enctype (on <form>) | Must be multipart/form-data, with method="POST", or only the file's name is sent. | MDN |




