On 23 October 2010 16:34, Cocy N <[email protected]> wrote: > I quote : > "4.5 Charset of text in form data > Each part of a multipart/form-data is supposed to have a content-type."
Yes, I saw that too... and wondered if it was arguable that the RFC contradicts itself. But.... as far as I can rationalise: Multipart data has to be turned into something... if you post a mix of text fields and files, if one of those files is a text file, both content-types would be "text/plain", so how would a server know which started on the form as a file-field and which was a text-field? It strikes me that the developers have to make assumptions, and it seems that a sensible assumption is that if a user-agent sends a multipart form; those elements without content-type (seeing as part of the RFC *does* say they're optional) are form fields, and those with it are files. It also strikes me that since every browser (or at least the dozen or so I've tested it with) seems to post multipart forms *without* content-type for fields, this may be a common conclusion, and if one testing application goes the other way, and sends up ambiguous data (is it a text field, or a text file?) while expecting to get the right thing back; using Occams Razor, can it be that favourable that all the other browsers and frameworks are wrong? Unless I'm overlooking something deep in the protocol.... -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

