How to use AngularJS $http to send multipart/form-data

前端 未结 2 415
南笙
南笙 2020-12-11 22:59

I am developing a graphical interface that uses different services rest (written in java). I have to call up a service like this:

@PUT
@Path(\"nomeServizio\"         


        
2条回答
  •  忘掉有多难
    2020-12-11 23:32

    in java code you need to write code like this:

    @POST
    @Path("/upload")
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    public Response uploadFile(
        @FormDataParam("file") InputStream uploadedInputStream,
        @FormDataParam("file") FormDataContentDisposition fileDetail) {
    

    for more you can refer bellow example and link :-

    https://www.mkyong.com/webservices/jax-rs/file-upload-example-in-jersey/

提交回复
热议问题