What is "Content-Disposition: file" ? #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi @mikedilger !
Thanks again for your library. It's quite nice 👍
I was reading the RFC on application/form-data and saw no mention of
Content-Disposition: file, which your library does seem to parse. The RFC says everything has to beContent-Disposition: form-data.But I did see a mention of
Content-Disposition: filein an old HTML spec. Do you have any more information about that ?Would love to know more, if you have the time 😃
Thanks,
Conrad
Hi Conrad,
IETF RFC 2388 section 4.4 mentions the "file" disposition which may be used in the case of multiple files within a sub-part.
We tried to code the library to handle all the cases that might reasonably be expected to show up. In any of these cases:
filenameparameter is set in aContent-Dispositionof a subpart,Content-Typeheader exists in a subpart,Content-Dispositionof a subpart is set to "file"...then that part of the whole is interpreted as a File and we move to the CapturingFile state.
Hope that helps, and feel free to ask for more details if you need them. If you see anything that looks wrong, I certainly would like to know.
Thanks,
Mike
Hi Mike,
Thanks for the explanations 👍
I agree with you that this all makes a lot of sense.
I wonder why the new RFC 7578, which obsoletes 2388, does not mention the
Content-Disposition: file. That sounds like a breaking change in the RFC. Or maybe I missed the part aboutContent-Disposition: filethere as well ?Thanks again,
Conrad
RFC 7578 part 4.3 deprecates the use of
multipart/mixedwithinmultipart/form-data. Clients certainly should not be producing such things any more. However, we like to be resilient; if some client uses it, we understand it.I suppose the IETF should have deprecated it in two steps: step 1 - clients no longer writing requests this way, and step 2 - servers no longer need to recognize them. But that did not seem to happen.
Great to hear you're being resilient :-)
Thanks for everything !
Edit: I had misunderstoof the obsoleted RFC before. I hadn't understood that
Content-Disposition: filewas only to be used in a subpart ofmultipart/mixed. This all makes a lot more sense now.