3

I need to encode file attachments at the Content-Disposition HTTP header attribute. I noticed that RFC 2231 is the latest widely-accepted standard and would like to use that. However, I have trouble finding an implementation of that within the core Java SE and Java EE libraries. Do you guys have any recommendations?

A brief search on Google yielded this but I ain't sure how trustworthy it is. I was hopping javax.mail.internet.MimeUtility supports RFC 2231 encoding method but it does not appear to (although it did mention RFC 2231 in decoding).

Any input would be welcomed. I am sure this is a common problem for Java web development.

Thanks.

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
Some Newbie
  • 1,059
  • 3
  • 14
  • 33
  • It's a mess, see http://stackoverflow.com/questions/93551/how-to-encode-the-filename-parameter-of-content-disposition-header-in-http – ZhongYu May 28 '13 at 00:40
  • I saw that post already. What I am looking for is an implementation. – Some Newbie May 28 '13 at 04:41
  • what I got from that post is that this mechanism is very unreliable, which is probably why there's no well known implementation of it. I'll adopt the solution given by @porneL – ZhongYu May 28 '13 at 16:04

1 Answers1

1

RFC 2231 is related to MIME (sending emails). Regarding HTTP you shoud read RFC 5987 or 6266.