What Is multipart/form-data?
multipart/form-data is the encoding a browser uses to send a form that includes files. Each field becomes its own part with its own headers, separated by a boundary string, which lets binary file content travel alongside ordinary text fields.
The default encoding, application/x-www-form-urlencoded, packs fields into one percent-encoded string. That is compact and completely unsuitable for a 4MB PDF, which is the entire reason multipart exists.
The rule in HTML is simple: a form containing a file input needs enctype="multipart/form-data" on the form tag. Leave it out and the browser sends only the file's name, which produces the classic bug where uploads appear to work and the file never arrives.
If you are posting with fetch instead, pass a FormData object as the body and do not set the Content-Type header yourself. The browser needs to generate the boundary string, and setting the header manually overwrites it with one that has no boundary, which makes the payload unparseable on the other end.
In WebForms
WebForms accepts urlencoded, multipart and JSON on the same endpoint and works out which one it received, so a form that gains a file input does not need a different URL.