JAX-RS upload file without Jersey

2019-02-27 19:43发布

I would like to know how to create a REST webservice that posts multipart request to upload the file without using third party libraries like Jersey or Spring.

Thanks.

标签: rest jax-rs
1条回答
ゆ 、 Hurt°
2楼-- · 2019-02-27 20:20
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Path("/uploadfile")
void uploadFile(@Context HttpServletRequest request, @Multipart(value = "file", type = MediaType.APPLICATION_OCTET_STREAM)Attachment file);
查看更多
登录 后发表回答