I’m not sure what kind of web container that you use.
Here is a link[1] about how to do it with tomcat 7.

[1]http://stackoverflow.com/questions/8047173/how-to-enable-multipart-form-data-in-tomcat-7-0-8-server

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 13, 2014 at 12:06:06 PM, navaltiger (vijay.ra...@gmail.com) wrote:
> Any pointer towards how to apply such filter?
>  
> On Thu, Nov 13, 2014 at 9:30 AM, Willem.Jiang [via Camel] <
> ml-node+s465427n5759023...@n5.nabble.com> wrote:
>  
> > We apply the multipart handler to jetty endpoint by default.
> > If you use camel-servlet, it’s your job to setup that kind of filter in
> > the web.xml to parser the Multipart form data for you.
> >
> > --
> > Willem Jiang
> >
> > Red Hat, Inc.
> > Web: http://www.redhat.com
> > Blog: http://willemjiang.blogspot.com (English)
> > http://jnn.iteye.com (Chinese)
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> >
> >
> > On November 12, 2014 at 6:35:59 PM, navaltiger ([hidden email]
> > ) wrote:
> >
> > > Hi,
> > >
> > > With Jetty based consumer it worked but no luck with servlet. I am
> > > executing this package as jetty:run
> > >
> > > public void configure() throws Exception {
> > > // getContext().getProperties().put("CamelJettyTempDir", "target");
> > >
> > > // Jetty://http works file
> > > // from("jetty://http://0.0.0.0:9090/test";).process(new Processor() {
> > > .// servlet:// does not work
> > > from("servlet:///test").process(new Processor() {
> > > public void process(Exchange exchange) throws Exception {
> > >
> > > Message in = exchange.getIn();
> > > StringBuffer v = new StringBuffer();
> > >
> > > v.append("\n" + in.getAttachmentNames().size() + "\n");
> > >
> > > Set names = in.getAttachmentNames();
> > > for (String n : names) {
> > > DataHandler h = in.getAttachment(n);
> > > v.append("\n" + h + "\n");
> > > if (h != null) {
> > > try {
> > > int read = 0;
> > > byte[] bytes = new byte[1024];
> > > // Object o = h.getContent();
> > > InputStream inputStream = h.getInputStream();
> > > FileOutputStream fout = new FileOutputStream(
> > > new File(
> > > "/Users/navaltiger/workspace/vr.bin"));
> > >
> > > while ((read = inputStream.read(bytes)) != -1) {
> > > fout.write(bytes, 0, read);
> > > }
> > > v.append("\n done \n");
> > > } catch (Exception e) {
> > > e.printStackTrace();
> > > }
> > > }
> > > }
> > > exchange.getOut().setBody(v);
> > > }
> > >
> > > });
> > > }
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5758976.html
> >   
> >
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
> >
> >
> > ------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> > http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5759023.html
> >   
> > To unsubscribe from Multipart form data and servlet/restlet endpoint, click
> > here
> >  
> > .
> > NAML
> >  
> >
>  
>  
>  
> --
>  
> *Vijay Rathi | T: +91 93734 33545 | vijay.ra...@gmail.com
> | *http://gadgetnfun.blogspot.com/
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5759024.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to