* Files have a content-type, the default content type is text/plain.
* Parameters have no content-type.
<quote>
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
"application/octet-stream".
</quote>
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?
Jürgen
On 19.05.2009 11:17, Jonathan del Strother wrote:
> Heya,
>
> 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.
>
> http://github.com/rack/rack/commit/6674f3652ed19136802a0b84f1923f0b78052442
> 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