Glossary

The enctype attribute explained.

The enctype attribute tells the browser how to encode a form's data when it POSTs, choosing between application/x-www-form-urlencoded (the default text format), multipart/form-data (for files), or text/plain.

Definition

How the form enctype attribute works

When a form submits by POST, the browser has to turn its fields into bytes for the request body, and enctype is the attribute that picks which format it uses.

There are three values. application/x-www-form-urlencoded is the default, packing every field into one text string of name=value pairs with special characters percent-escaped, which is compact and right for ordinary text forms. multipart/form-data splits the fields into separate labeled parts and is the only value that can carry uploaded files. text/plain sends the fields as unescaped lines and is rarely used outside debugging. Whichever you choose, the browser sets a matching Content-Type header so the server knows how to parse what arrives. The attribute only applies to POST, since a GET form always appends its fields to the URL.

For a form backend, enctype is simply how your HTML declares the shape of the body it is about to send, and FormWire reads either common encoding, so a plain contact form and a form with a file attachment both parse correctly on arrival.

Related questions

Want to see it working?

Read the docs
Ready in a minute

Encode your form the right way.

Free tier forever. No credit card required.