* Files have a content-type, the default content type is text/plain.
* Parameters have no content-type.
As with all multipart MIME types, each part has an optional
"Content-Type", which defaults to text/plain. If the contents of a
file are returned via filling out a form, then the file input is
identified as the appropriate media type, if known, or
Browsers definitely do it like this. Curl does it like this. net/http
with multipart addon does it like this. What lib does your client app use?
On 19.05.2009 11:17, Jonathan del Strother wrote:
> I upgraded to Rack 1.0 recently and ran into some problems with our
> client app uploading multipart form data.
> The app uploads a file along with bunch of string parameters, with
> each string's multipart section marked as "Content-Type: text/plain;
> charset=utf-8". This used to work fine - rails would see the params
> as a hash of strings, and a File object for the file.
> changed this behaviour - because the strings have a Content-Type, even
> though they're just text/plain, they become File objects.
> Is this the correct behaviour? It certainly surprised me - since text/
> plain is the default content type, I would have thought that re-
> specifying it would have no effect (that said, we are specifying a
> charset, which I guess changes things a little).
> ( On a related note : I notice that Safari& Firefox don't specify a