[thelist] Multipart uploads -- encoding of "filename"

Bill Moseley moseley at hank.org
Mon May 24 09:00:26 CDT 2010

On Mon, May 24, 2010 at 4:08 AM, Jack Timmons <jorachim at gmail.com> wrote:

> On Sun, May 23, 2010 at 10:44 PM, Bill Moseley <moseley at hank.org> wrote:
> > I looked through RFC1867 but didn't see any reference to charset.
> Should
> > the client's browser be encoding the "filename" content-disposition into
> > utf8 when the form has accept-charset="utf8" regardless of how the
> filename
> > is encoded on the client's machine?
> It doesn't work well in Internet Explorer, that I recall.
> 1 - http://www.w3schools.com/tags/att_form_accept_charset.asp
> 2 - http://msdn.microsoft.com/en-us/library/ms533061(VS.85).aspx
> 3 - http://reference.sitepoint.com/html/form/accept-charset

Thanks for the links.  It's not entirely clear what IE's issue is.  The MSDN
page says that IE will attempt to guess the encoding if not specified, which
is not my case.

The other pages give the same example:

Internet Explorer’s support for accept-charset is buggy. If the attribute’s
> specified as "ISO-8859-1", IE will happily send data encoded as
> "Windows-1252".

Which is not clear if that's a problem with that specific charset or just an
example of how IE is buggy.  So, not sure if that applies when I am
specifying the charset.

I couldn't find this exactly but if my form is on a page with HTTP header
including charset utf8 and the form has accept-charset utf8 but the POST
from the browser does not have a charset in the HTTP headers, should I
assume utf8?

For example, I have Chrome on this laptop and I see this HTTP header when I
post a form -- not no charset:


And then the upload element of that form is:

Content-Disposition: form-data; name="file_1"; filename="test.pdf"
Content-Type: application/pdf

Which says the content type of the upload only.

So, there's really nothing saying what the charset of "filename" is there.

Should browsers add a charset to the Content-Type http header for Multipart

Bill Moseley
moseley at hank.org

More information about the thelist mailing list