Struts multipart/form-data textarea character set issue

Discussion in 'Java' started by Marcia, Oct 20, 2005.

  1. Marcia

    Marcia Guest

    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?
    Marcia, Oct 20, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Li Zhang
    Replies:
    4
    Views:
    6,057
    softip
    Feb 27, 2009
  2. Matt
    Replies:
    8
    Views:
    142,260
    zeeshanakhter2009
    May 26, 2012
  3. Duncan
    Replies:
    0
    Views:
    1,451
    Duncan
    Feb 24, 2006
  4. Kevin DeValck
    Replies:
    1
    Views:
    723
    7stud --
    May 17, 2011
  5. Replies:
    1
    Views:
    395
Loading...

Share This Page