Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 71646 invoked from network); 14 Jul 2010 17:56:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Jul 2010 17:56:17 -0000 Received: (qmail 84660 invoked by uid 500); 14 Jul 2010 17:56:17 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 84616 invoked by uid 500); 14 Jul 2010 17:56:17 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 84608 invoked by uid 500); 14 Jul 2010 17:56:17 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 84605 invoked by uid 99); 14 Jul 2010 17:56:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jul 2010 17:56:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jul 2010 17:56:14 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o6EHtqXn008675 for ; Wed, 14 Jul 2010 17:55:53 GMT Message-ID: <25912392.41991279130152973.JavaMail.jira@thor> Date: Wed, 14 Jul 2010 13:55:52 -0400 (EDT) From: "Paul Mietz Egli (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Issue Comment Edited: (CAMEL-2772) camel-jetty can't deal with multiform data rightly In-Reply-To: <27431038.6361275353751803.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60659#action_60659 ] Paul Mietz Egli edited comment on CAMEL-2772 at 7/14/10 1:54 PM: ----------------------------------------------------------------- In case anyone finds this bug and need direction, here's the workaround that I use when processing attachments. Note that I set the Exchange.FILE_NAME header to the attachment name prior to calling this code, as dh.getName() always seems to return null in Camel 2.3.0: {code} DataHandler dh = exchange.getIn().getAttachment("myfile.txt"); if (dh.getContent() instanceof DataSource) { InputStream in = ((DataSource) dh.getContent()).getInputStream(); String name = dh.getName() != null ? dh.getName() : exchange.getIn().getHeader(Exchange.FILE_NAME, String.class); String contentType = dh.getContentType(); } {code} was (Author: pegli): In case anyone finds this bug and need direction, here's the workaround that I use when processing attachments. Note that I set the Exchange.FILE_NAME header to the attachment name prior to calling this code, as dh.getName() always seems to return null in Camel 2.3.0: {code} DataHandler dh = exchange.getIn().getAttachment("myfile.txt"); if (dh.getContent() instanceof DataSource) { InputStream in = ((DataSource) dh.getContent()).getInputStream(); String name = dh.getName() != null ? dh.getName() : exchange.getIn().getHeader(Exchange.FILE_NAME, String.class); String contentType = dh.getContentType(); } {code} > camel-jetty can't deal with multiform data rightly > -------------------------------------------------- > > Key: CAMEL-2772 > URL: https://issues.apache.org/activemq/browse/CAMEL-2772 > Project: Apache Camel > Issue Type: Bug > Components: camel-jetty > Affects Versions: 2.3.0 > Reporter: Willem Jiang > Assignee: Willem Jiang > Fix For: 2.4.0 > > > You can't get the inputStream from the attachment when camel-jetty handle the request of MultiPartForm. > Here is the mail thread[1] which discusses about it. > [1] http://old.nabble.com/Unsupported-data-type-exception-with-Jetty-component-tp28730373p28731758.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.