Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5C55B17260 for ; Wed, 12 Nov 2014 06:04:26 +0000 (UTC) Received: (qmail 84802 invoked by uid 500); 12 Nov 2014 06:04:25 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 84755 invoked by uid 500); 12 Nov 2014 06:04:25 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 84743 invoked by uid 99); 12 Nov 2014 06:04:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 06:04:25 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.223.181 as permitted sender) Received: from [209.85.223.181] (HELO mail-ie0-f181.google.com) (209.85.223.181) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 06:04:00 +0000 Received: by mail-ie0-f181.google.com with SMTP id rp18so12499645iec.26 for ; Tue, 11 Nov 2014 22:03:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=t6GrHralWvSUNWsF+w8QnXUijhq02IwFvVLYKleBgCM=; b=TvpfYbslZV+Zj2CEHB5vw4pR9cs5DFN2/ErOAVvHvhiFbp25QlKHX90MBaYeJq0qt+ NA2A0pX5kmNr0ECDq8H5Rfy22CUgWaeUVeX9JTdzA2wAvVwUo/NGWWqyoXu60tP6xwif F+211UeisFFyJMvU4nT9CActsI3YTGE9fwEKWiTL+yOZolbqSvOlzhdsosO9CjgOOw6Y MXAHFQE3qT8D1OGIKVTvn3g4BxzwJVDU0hTHOaV+7py4/UhRAbsf20NNnocErGO9V99A jx7JGIpihiixnfj/kzuUD7xJY0zTyLx6v14L4FUNlg0ypMDAQaXafVxmj5drIKpS321K Jimw== X-Received: by 10.107.166.141 with SMTP id p135mr38928705ioe.16.1415772239471; Tue, 11 Nov 2014 22:03:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.126.136 with HTTP; Tue, 11 Nov 2014 22:03:39 -0800 (PST) In-Reply-To: <1415766108580-5758948.post@n5.nabble.com> References: <1415766108580-5758948.post@n5.nabble.com> From: Claus Ibsen Date: Wed, 12 Nov 2014 07:03:39 +0100 Message-ID: Subject: Re: Multipart form data and servlet/restlet endpoint To: "users@camel.apache.org" Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi Maybe see if you can find some samples in camel-servlet / camel-jetty unit tests that deals with attachments. And attachments would be on the Camel Message with the getAttachments method. On Wed, Nov 12, 2014 at 5:21 AM, navaltiger wrote: > dear all, > > I am looking to implement a route where reslet/cxfrs end point will accept > file as multipart request and process. (Request may have some JSON data as > well. > > For sake of simplify thing and get it working with servlet first have tried > following code. Also tried sending file using curl. I can see file related > info in headers and debug output, but not able to retrieve attachment. But > no luck. > (Additional info: I am running project as mvn jetty:run. The package is in > form of war and will be deployed on web logic server. Moreover, stream > caching is not in place.) > > from("servlet:///hello").process(new Processor() { > @Override > public void process(Exchange exchange) throws Exception { > Message in = exchange.getIn(); > StringBuffer v = new StringBuffer(); > HttpServletRequest request = (HttpServletRequest) in > .getHeaders().get(Exchange.HTTP_SERVLET_REQUEST); > > DiskFileItemFactory diskFile = new DiskFileItemFactory(); > FileItemFactory factory = diskFile; > ServletFileUpload upload = new ServletFileUpload(factory); > List items = upload.parseRequest(request); > ..... > > > > -- > View this message in context: http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: cibsen@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/