camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: updload server multipart
Date Wed, 16 Jun 2010 01:31:55 GMT
Oh, the mulitpart request is handled by the MultiPartFilter which is 
shipped with Jetty. So I don't think you can do it in your processor.

I think I can provide a option not to install the MultiPartFilter in 
Jetty endpoint, so you can handle the MultiPart request in your way.

Please feel free to log a JIRA for it.

Willem

Tapdur wrote:
> hi willem
> 
> 
> we tried to updload in an other way but in lost, i think the is an other bug
> :
> (in a .processor(...) {
> 
> 			HttpMessage msg = (HttpMessage) exchange.getIn();
> 				
> 	    		HttpServletRequest request = msg.getRequest();
> 
> 	    		boolean isMultipart = ServletFileUpload.isMultipartContent(request);
> 	    		
> 	    		String messageFileName = null;
> 	    		
> 	    		if (isMultipart) {
> 					// Create a new file upload handler
> 					ServletFileUpload upload = new ServletFileUpload();
> 					
> 					// Parse the request
> 					FileItemIterator iter = upload.getItemIterator(request);
> 
> 
> the iter returned by upload.getItemIterator() is null.
> 
> 
> what do you think
> 
> Regards 
> Bruno
> 
> 
> 
> 
> 
> 
> 
> willem.jiang wrote:
>> Hi Bruno,
>>
>> I'm sorry, I just found the ClassCastException when I replied your 
>> letter, so the patch is fresh.
>> I'm afraid you have to apply the patch[1] to CAMEL-2.3.0 yourself, 
>> otherwise you have to wait for the CAMEL 2.4.0 release.
>>
>> [1] https://issues.apache.org/activemq/browse/CAMEL-2806
>>
>> Willem
>>
>> Tapdur wrote:
>>> we have this class cast exception with 2.3.0
>>>
>>>
>>> :jetty-7.0.1.v20091125
>>> 2010-06-14 16:11:40.625:WARN::FAILED
>>> org.eclipse.jetty.servlets.MultiPartFilter: java.lang.ClassCastException:
>>> java.lang.String cannot be cast to java.io.File
>>> 2010-06-14 16:11:40.625:WARN::FAILED
>>> ServletContextHandler@16a9b9c@16a9b9c/,null:
>>> java.lang.ClassCastException:
>>> java.lang.String cannot be cast to java.io.File
>>> 2010-06-14 16:11:40.625:WARN::Error starting handlers
>>>
>>> with your test java code
>>>
>>>
>>> Regards
>>>
>>>
>>>
>>> willem.jiang wrote:
>>>> Hi,
>>>>
>>>> Here is an unit test[1] that you can take a look.
>>>>
>>>> [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java
>>>>
>>>> Willem
>>>> Tapdur wrote:
>>>>> hi
>>>>> a client post a http/multipart file to my camel server
>>>>> how handle and store it on the server side with camel 2.3.0 ?
>>>>> thx
>>>>> bruno 
>>>>
>>
>>
> 


Mime
View raw message