Bootstrap file upload form

Build a file upload form with Bootstrap 5 and no upload API. Bootstrap 5 styles file inputs with the same form-control class as everything else, and the file posts straight to Formpaste. Copy the markup and add your access key.

How to build it

  1. Create a form in your Formpaste dashboard and copy its access key.
  2. Connect Storage in the dashboard so the form can accept uploads.
  3. Copy the markup below, add your access key, then publish.

Prompt for your AI coding agent

Give me a Bootstrap 5 file upload form that POSTs multipart/form-data to https://api.formpaste.com/submit with a hidden access_key input. Use form-label, form-control on the file input, form-text for the hint, and btn btn-primary. Do not build an upload endpoint of my own.

Or connect the Formpaste MCP server to Claude Code, Codex, Cursor, Claude Desktop, VS Code, or any mcp-remote client. See the setup guide.

Bootstrap gotchas

Bootstrap styles the form, Formpaste receives it. Point a normal Bootstrap form at the Formpaste endpoint, keep the hidden access key, and submissions land in your inbox. There is no plugin, no jQuery, and no backend of your own.

It is a normal form with Bootstrap classes

Nothing about Bootstrap changes how a form submits. Add form-label, form-control and btn btn-primary to the usual markup, set the action to the Formpaste endpoint, and the browser posts it. Bootstrap only supplies the styling.

Validation styles are presentation only

was-validated, is-invalid and invalid-feedback style the form in the browser. They do not filter spam and they do not validate anything server-side. Formpaste still applies its own spam filtering after the post.

Use the Bootstrap 5 class names

Bootstrap 5 renamed several form classes: form-group became mb-3, custom-select became form-select, and form-control-file became form-control. If you are copying an older Bootstrap 4 snippet, update those names or the styling will not apply.

Keep the hidden access_key

Leave the hidden access_key input in place so Formpaste knows which form the submission belongs to. It is a normal input, so Bootstrap's styles ignore it.

What to get right

A file means multipart, not urlencoded

As soon as the form has a file input, it must post multipart form data. The generated code sets enctype and sends the raw FormData, so the file rides along with the other fields. No upload endpoint of your own is needed.

The upload is client to Formpaste, direct

The browser posts the file straight to Formpaste, so your app never buffers or parses the upload. That sidesteps serverless body-size and runtime limits entirely.

Set expectations on size and type

Tell people what you accept. File uploads are a Pro feature; connect Storage in the dashboard first, and keep the input honest about accepted types and size.

How it works

Three simple steps for form submissions to land in your email inbox.
Create your form, set your form's action URL to Formpaste's endpoint, and add your access key.

1

Create your form

Sign up, verify your email, and create an access key in your dashboard.

2

Copy the code

Paste the snippet above into your project. Pick CSS or Tailwind to match your site.

<form action="https://api.formpaste.com/submit" method="POST" enctype="multipart/form-data">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY_HERE">
  <div class="mb-3">
    <label for="email" class="form-label">Email</label>
    <input type="email" class="form-control" id="email" name="email" required>
  </div>
  <div class="mb-3">
    <label for="file" class="form-label">Attachment</label>
    <input type="file" class="form-control" id="file" name="file">
    <div class="form-text">PDF or image, up to 10 MB.</div>
  </div>
  <button type="submit" class="btn btn-primary">Upload</button>
</form>
3

Add your access key

Replace the placeholder with your access key to start receiving submissions.

<input type="hidden" name="access_key" value="YOUR_ACCESS_KEY_HERE">

Bootstrap file upload form FAQ

Paste a form. Get submissions.

Instantly without setting up any backend, servers or databases. 250 submissions/mo free - no credit card.

Other Bootstrap forms