Resteasy destroys filename encoding on multipart/form-data POST requests

寵の児 提交于 2019-12-06 11:47:15

问题


I do a fileupload to the following annotated Restservice

@POST
@Path("/uploadFile")
@Consumes("multipart/form-data")
public Response uploadFile(MultipartFormDataInput input)

When special characters in the filename like "äÄöÖüÜß" are used, the filename gets corrupted during processing of Resteasy subsystem.

I verified this by creating a Logginginterceptor

@Provider
@ServerInterceptor
public class LoggingInterceptor implements PreProcessInterceptor

Inside this interceptor, the http fileupload (multipart/form-data) is still correct

Content-Disposition: form-data; name="file"; filename="TestäÄöÖüÜßFile2.pdf" Content-Type: application/pdf

when Resteasy calls the uploadFile Method, the filename is corrupted

Content-Disposition: form-data; name="file"; filename="Test��������������File2.pdf" Content-Type: application/pdf

Is there a possibility (maybe by some annotation) to preserve the filename encoding in the Entity?

Kind regards

Shane

来源:https://stackoverflow.com/questions/38401395/resteasy-destroys-filename-encoding-on-multipart-form-data-post-requests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!