On Oct 24, 12:46 am, Michael Pavling <[email protected]> wrote:
> On 23 October 2010 16:34, Cocy N <[email protected]> wrote:

> 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?

I think this might be the answer (solution?) for your question.
I quote :
"In the case where a field element is text, the charset
parameter for the text indicates the character encoding used."

I don't know how the server distinguishing if the data is text or text-
file, though.

> 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?

Yes, as you mentioned, posting multipart forms *without* content-type
(and character encoding if it's text) for fields may be a common
conclusion.
But since it's *optional*, I think, it could be (and could not be)
there.....

Anyways, I got through my problem, so I don't care at this time.

BTW, thanks for your reply.
You are the only one who replied to my post :)

-- 
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.

Reply via email to