File upload services using jersey in tomcat without maven

浪子不回头ぞ 提交于 2019-12-06 05:09:38

I tried with the similar code

    //code
@POST
@Path("/uploadImage")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response uploadFile(@FormDataParam("file") InputStream uploadedStream,
        @FormDataParam("file") FormDataContentDisposition fileDetail) {
    String fileName = fileDetail.getFileName();
    saveToFile(uploadedStream,fileName);
    String output = "File saved to server location : " + fileName;
    return Response.status(200).entity(output).build();
}

with bellow jar files in (Tomcat 7) & it is working fine

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