问题
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.
回答1:
RFC 2231 is related to MIME (sending emails). Regarding HTTP you shoud read RFC 5987 or 6266.
来源:https://stackoverflow.com/questions/16782005/how-can-i-encode-a-filename-according-to-rfc-2231