JAX-RS upload file without Jersey

后端 未结 1 1197
悲&欢浪女
悲&欢浪女 2021-01-24 02:02

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.

1条回答
  •  伪装坚强ぢ
    2021-01-24 02:52

    @POST
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    @Path("/uploadfile")
    void uploadFile(@Context HttpServletRequest request, @Multipart(value = "file", type = MediaType.APPLICATION_OCTET_STREAM)Attachment file);
    

    0 讨论(0)
提交回复
热议问题