HTML 5 · Forms

Accept a file upload

A form that uploads files needs the multipart encoding.

<form method="post" enctype="multipart/form-data">
  <input type="file" name="photo" accept="image/*">
</form>

Official HTML 5 documentation

More forms commands

All forms commands · HTML 5 cheatsheet

Was this page helpful?