HTML File Input — upload files from a form (live demo)
An <input type="file"> lets a user pick one or more files from their device to upload with the form. The form must use method="post" and enctype="multipart/form-data" so the file's bytes travel in the request body. Below is a working upload form that actually submits.
Updated June 2026 · The <input type="file"> element · 12 elements in the reference
<form action="https://splitforms.com/api/submit" method="POST" enctype="multipart/form-data">
<input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<label for="resume">Upload your resume (PDF)</label>
<input type="file" id="resume" name="resume" accept=".pdf,.doc,.docx" required>
<input type="checkbox" name="botcheck" style="display:none">
<button type="submit">Send application</button>
</form>Replace YOUR_ACCESS_KEY with a key from your free splitforms dashboard. The form posts to one endpoint — submissions land in your inbox and dashboard with spam filtering built in.
You need the right enctype
Without enctype="multipart/form-data" on the <form>, the browser sends the filename as text but drops the file contents. File uploads silently fail.
Use POST, never GET
Files can only travel in a POST body. A GET form strips them entirely.
accept is not validation
It filters the file picker, but users can override it. Validate the type and size again on the server before storing anything.