splitforms.com

HTML · FORM CONTROL

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.

  • 500 free / mo
  • No backend
  • Copy-paste ready
HTML File Input (Upload) — copy-paste HTML form code that actually submits

Copy-paste ready

The HTML File Input (Upload) example below is a complete, working form — paste it into any HTML page and it submits, no edits to the markup required.

No backend to build

Your html file input (upload) form posts to one endpoint. No server, PHP, or API route — submissions land in your inbox and a searchable dashboard.

A form that really submits

Unlike a static reference snippet, this <input type="file"> form actually sends data to a free splitforms backend, with spam filtering built in.

Copy-paste code

HTML File Input (Upload) code you can paste today.

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.

Get free access key
file-input.html
<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>

How it works

How to add HTML File Input (Upload) to any page.

Copy the html file input (upload) example, drop in your free access key, and paste it into any page — submissions start landing in your dashboard.

Copy the code

Copy the HTML File Input (Upload) example below.

Add your access key

Replace YOUR_ACCESS_KEY with a free splitforms key from the dashboard.

Paste into your site

Drop the form into any HTML page. Submissions arrive in your dashboard.

The <input type="file"> element

Which HTML File Input (Upload) attributes matter?

The <input type="file"> element takes a handful of attributes — these decide how your form behaves and what actually gets emailed to your inbox when someone submits.

  • accept — Restricts the picker to file types, e.g. ".pdf", "image/*", "image/png, image/jpeg". It's a hint, not a security check.
  • multiple — Boolean. Lets the user select more than one file at once.
  • capture — On mobile, hints to use the camera or microphone (e.g. capture="user").
  • name — The key the file(s) are submitted under. Required for the upload to be sent.
  • required — Boolean. Blocks submit until a file is chosen.
HTML File Input (Upload) attributes reference

Common mistakes

HTML File Input (Upload) not working? Here's why.

Most broken forms come down to a few small mistakes with the <input type="file"> element. Check these before you ship — then forward every submission to Slack or a webhook.

  • 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.
Common html file input (upload) mistakes to avoid

How SplitForms works

From form to workflow in 3 simple steps.

Connect your form, collect every submission, and send data where it needs to go — without building backend infrastructure.

A SplitForms contact form submission launching straight to your inbox

Add your endpoint

Point your form to your unique SplitForms endpoint. That's it.

HTML form pointing at a SplitForms submit endpoint

Receive submissions

We instantly capture and organize every submission in your inbox.

Submissions inbox with searchable leads and status pills

Route anywhere

Send data to email, spreadsheets, CRMs, webhooks, and 7,000+ apps.

Generic integration tiles for email, sheets, chat, CRM, automate, and webhook

No credit card required. Set up in under 60 seconds.

Connect & automate

Connect your favorite tools and automate everything

SplitForms works with the destinations you route to and the platforms you build on — from Slack and Sheets to WordPress, Shopify, and Next.js.

Connect your SplitForms form to Slack, Google Sheets, Mailchimp, Zapier and more

Trusted by indie teams and agencies shipping forms worldwide

PETAL/COKRAFT.DELINEAR-XBUILD.DEVSTUDIO 71MERIDIANFRAME&CO

Testimonials

Loved by developers shipping at every scale.

40 quotes on record — from indie hacks to agency migrations.

Questions

HTML File Input (Upload) questions, answered.

View all FAQs
How do I upload a file in HTML?

Use <input type="file" name="resume"> inside a <form> with method="post" and enctype="multipart/form-data". The browser sends the file in the request body to the form's action URL.

What is the correct enctype for file upload?

multipart/form-data. It encodes the form fields and the file contents as separate parts of the request body, which is required for the file to arrive intact. application/x-www-form-urlencoded (the default) drops the file data.

How do I restrict file types in an upload?

Add an accept attribute, e.g. accept=".pdf" or accept="image/png, image/jpeg". This filters what the file picker shows, but it is a UX hint only — re-validate the type and size on the server.

How do I let users upload multiple files?

Add the multiple attribute to the input: <input type="file" name="photos" multiple>. The user selects more than one file, and they are submitted as an array under the same name.

Why is my file input not uploading?

The three usual causes: the <form> is missing enctype="multipart/form-data", the method is get instead of post, or the backend receiving the action URL doesn't accept multipart uploads. Check the request in the Network tab.

Simple pricing

Start free. Scale when you need more.

Choose a plan that fits your workflow — from a free form endpoint to full automations, exports, and higher submission limits.

Free

$0

Free forever

 
Best for testing

For side projects and indie devs.

  • 500 submissions / mo
  • Unlimited forms
  • Email notifications included
  • Honeypot spam filtering
  • Submissions dashboard
  • MCP setup stays free
  • No credit card required

3-Year

$59/ 36 months
was $99 · save 40% · new-user price

Pay $59. 3 years sorted.

  • 15,000 submissions / mo
  • Unlimited forms
  • Everything in Pro
  • Renews every 3 years
  • Long-term discount
  • Priority support included
  • Vote on the roadmap

No credit card required on Free • Cancel anytime