# Protecting file upload forms

A form that stores a file is a write. The post can fill a disk, create a row, and leave you a file to review. Mark the form, let the page script earn a pass, and check the pass before you save the upload. People never pay money. Attackfee does not read the file and does not replace your size limits or file checks.

You can add this to a plain HTML page:

```html
<script src="/attackfee/v1/attackfee.js" async></script>
<form method="post" action="/upload" enctype="multipart/form-data" data-attackfee="write">
  <button type="submit">Upload</button>
  <noscript>This form needs JavaScript.</noscript>
</form>
```

Serve that script from your own origin. The server that receives the post still has to check the pass before it stores the file. The WordPress plugin does not wrap the media library or an arbitrary upload form on its own. Mark the form and check it with `attackfee_wp_verify_request('write')`.

If the upload is sent by a script to a write API instead of a form, protect that route the same way you protect other write APIs, and have the client present a pass.

## Where Attackfee fits

See [How to add Attackfee to a form](/learn/concepts/how-to-add-attackfee-to-a-form), [How to check writes on your own server](/learn/concepts/how-to-check-writes-on-your-server), and [Protecting public write APIs](/learn/write-surfaces/public-write-apis).

- [Attackfee](/)
- [Learn](/learn)
- [Write surfaces](/learn/write-surfaces)
- [Protecting file upload forms](/learn/write-surfaces/file-upload-forms)

## Related

- [What is a write surface?](/learn/concepts/what-is-a-write-surface)
- [Protecting public write APIs](/learn/write-surfaces/public-write-apis)
- [Why a write API costs the owner when called at volume](/learn/write-surfaces/why-a-write-api-costs-the-owner-when-called-at-volume)
- [How to add Attackfee to a form](/learn/concepts/how-to-add-attackfee-to-a-form)
- [How to check writes on your own server](/learn/concepts/how-to-check-writes-on-your-server)
- [WordPress theme forms the plugin does not wrap](/learn/wordpress/wordpress-theme-forms-the-plugin-does-not-wrap)
- [Widget](/docs/widget)
- [Server](/docs/server)

## Questions



### "Does Attackfee inspect the file?"

"No. The check never reads form fields or file contents. You still apply your own size limits and file checks."

### "Does the WordPress plugin wrap the media library?"

"No. An upload form in a theme or another plugin is a form you mark and check. The plugin's built-in coverage is the forms already listed in the WordPress docs."

### "Is an upload a write even when there is no text field?"

"Yes, if the route stores something. A file is a change on your site, so the route that accepts it needs a pass."

### "Do people pay to upload a file?"

"No. People never pay money. Their browser earns a work pass in the background."
