cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamalissimo <roman.janu...@gmail.com>
Subject Re: Multipart file upload
Date Thu, 11 Jul 2013 06:40:59 GMT
Hello guys,

thanks for help. I finally made it working:

REST part:

	@POST
	@Consumes(MediaType.MULTIPART_FORM_DATA)
	@Path("/upload")
	@Produces(MediaType.APPLICATION_JSON)
	public Response uploadFile(
		@Multipart(value = "document") @NotNull Attachment attachment,
		@Multipart("product") String product,
		@Multipart("uploader") String uploader,
		@Multipart("folderId") String folderId) {
		
		return null;
	}

This the way I can access all neccessary information:

   Attachment att = exchange.getIn().getBody(Attachment.class);

   System.out.println("Disposition = " + att.getContentDisposition());
   System.out.println("Headers" + att.getHeaders());
   System.out.println("File name" + att.getDataHandler().getName());

Hope it will help somebody :-)




-----
-Br, Roman
--
View this message in context: http://cxf.547215.n5.nabble.com/Multipart-file-upload-tp5730547p5730583.html
Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message