4.2. Content-Disposition Header Field for Each Part
4.2. Content-Disposition Header Field for Each Part
Each part MUST contain a Content-Disposition header field [RFC2183] where the disposition type is "form-data". The Content-Disposition header field MUST also contain an additional parameter of "name"; the value of the "name" parameter is the original field name from the form.
For example, a part might contain a header field such as:
Content-Disposition: form-data; name="user"
For form data that represents the content of a file, a name for the file SHOULD be supplied as well, by using a "filename" parameter of the Content-Disposition header field. The file name is not mandatory for cases where the file name is not available or is meaningless or private; this might result, for example, when selection or drag-and-drop is used or when the form data content is streamed directly from a device.
If a "filename" parameter is supplied, the requirements of [RFC2183] Section 2.3 with respect to the receiving user agent's processing of that parameter apply. In particular, the file name should be treated as advisory; when possible, the receiver SHOULD accommodate the sender's supplied file name, but receivers are cautioned that such accommodation might result in unexpected or dangerous behavior (see Section 7).