Struts multipart/form-data textarea character set issue

M

Marcia

I have a form I am submitting that allows the user to post a message
and alternately also add a file attachment. The file attachment
portion means that the form has enctype multipart/form-data. So when
the form gets to my server, the other fields in the form are parts to
the form as expected. The form is a jsp page and I am submitting it to
a struts 1.1 application. The code works great on my local PC, but
when the code is deployed to our test server, it is interpreting the
incoming data from the textarea with a different encoding character
set.

I see in RFC 2388 that you are supposed to be able to set a
content-type for text data on a multipart/form-data, and this would
allow a character set for the data in the text field to be specified.
I also see, digging into the struts code, that it appears to look for
this attribute to be set when parsing the multipart/form-data into
request parameters.

However, I can't actually find any documentation, struts, jsp, html, or
otherwise, describing how this content-type property would be *set* for
an element on a multipart/form-data that contains a text field. The
RFC gives an example:

--AaB03x
content-disposition: form-data; name="field1"
content-type: text/plain;charset=windows-1250
content-transfer-encoding: quoted-printable

Joe owes =80100.
--AaB03x

But how do I actually set the content-type (including the charset
attribute) in real life?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top