Problems with file upload and extended characters

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with file upload and extended characters

idwright
Hi,

I'm trying to upload a file with extended characters e.g. é in the file
name.

It does work however the extended character is replaced with a ? which
is not great. (Looking at the httpclient.wire.content I believe that
it's Orbeon doing this rather than eXist)

The ins-upload instance contains the correct value for the file name so
as a work around I tried to do a put using that value however this
results in a binding exception but only when there are extended
characters in the name.

Any ideas?

Thanks,
Ian

<xforms:submission id="sub-after-upload" method="put"
         
resource="{instance('ins-uploaded-file')/atom:link[@rel='edit']/@href}"
         ref="instance('ins-uploaded-file')"
         replace="none"  mediatype="application/atom+xml"
 >
<xforms:action ev:event="xforms-submit-done">
<xforms:message level="modal">
                 Your file has been submitted. Thank you.
</xforms:message>
<!-- clear out upload -->
<xforms:insert nodeset="instance('ins-upload')"
                 origin="instance('ins-upload-empty')" />
<!-- refresh submitted media -->
<xforms:send submission="sub-get-submitted-media-feed" />

</xforms:action>
</xforms:submission>

<xforms:submission id="sub-post-upload" method="form-data-post"
         
resource="{instance('ins-study-entry')/atom:link[@rel='http://www.cggh.org/2010/chassis/terms/submittedMedia']/@href}"
         ref="instance('ins-upload')" instance="ins-uploaded-file"
replace="instance" >

<xforms:header>
<xforms:name>Accept</xforms:name>
<xforms:value>application/atom+xml</xforms:value>
</xforms:header>

<xforms:action ev:event="xforms-submit-done">

<xforms:setvalue ref="instance('ins-uploaded-file')//atom:title/text()"
value="instance('ins-upload')//media/@filename"/>

<xforms:send submission="sub-after-upload" />

</xforms:action>


<xforms:message ev:event="xforms-submit-error" level="modal">
             An error occurred (
<xforms:output value="event('error-type')" />
             ) while posting an upload.
</xforms:message>

</xforms:submission>

2011-12-06 09:44:13,017 ERROR org.orbeon.oxf.webapp.ProcessorService  -
Exception at
org.orbeon.oxf.common.ValidationException: : Binding exception for
target: sub-post-upload
null, line -1, column -1: Binding exception for target: sub-post-upload
     at
org.orbeon.oxf.xforms.submission.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:299)
     at
org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1021)
     at
org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
     at
org.orbeon.oxf.xforms.XFormsInstance.setValueForNodeInfo(XFormsInstance.java:376)
     at
org.orbeon.oxf.xforms.action.actions.XFormsSetvalueAction.doSetValue(XFormsSetvalueAction.java:111)
     at
org.orbeon.oxf.xforms.action.actions.XFormsSetvalueAction.execute(XFormsSetvalueAction.java:80)
     at
org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runSingleIteration(XFormsActionInterpreter.java:295)
     at
org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:256)
     at
org.orbeon.oxf.xforms.action.actions.XFormsActionAction.execute(XFormsActionAction.java:66)
     at
org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runSingleIteration(XFormsActionInterpreter.java:295)
     at
org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:256)
     at
org.orbeon.oxf.xforms.event.XFormsEventHandlerImpl.handleEvent(XFormsEventHandlerImpl.java:204)
     at
org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1000)
     at
org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
     at
org.orbeon.oxf.xforms.submission.BaseReplacer$1.run(BaseReplacer.java:39)
     at
org.orbeon.oxf.xforms.submission.XFormsModelSubmission.doSubmit(XFormsModelSubmission.java:487)
     at
org.orbeon.oxf.xforms.submission.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:295)
     at
org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1021)
     at
org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
     at
org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEventCheckTarget(XFormsContainingDocument.java:925)
     at
org.orbeon.oxf.xforms.XFormsContainingDocument.handleExternalEvent(XFormsContainingDocument.java:905)
     at
org.orbeon.oxf.xforms.processor.XFormsServer.createAndDispatchEvents(XFormsServer.java:519)
     at
org.orbeon.oxf.xforms.processor.XFormsServer.doIt(XFormsServer.java:328)
     at
org.orbeon.oxf.xforms.processor.XFormsServer.access$000(XFormsServer.java:63)
     at
org.orbeon.oxf.xforms.processor.XFormsServer$1.readImpl(XFormsServer.java:94)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$ConcreteProcessorFilter$ForwarderProcessorOutput.read(ProcessorImpl.java:1046)
     at
org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
     at
org.orbeon.oxf.processor.validation.MSVValidationProcessor.access$600(MSVValidationProcessor.java:45)
     at
org.orbeon.oxf.processor.validation.MSVValidationProcessor$3.readImpl(MSVValidationProcessor.java:215)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$ConcreteProcessorFilter.read(ProcessorImpl.java:1070)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
     at
org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
     at
org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:450)
     at
org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer.access$900(XSLTTransformer.java:73)
     at
org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer$1.runTransformer(XSLTTransformer.java:359)
     at
org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer$1.readImpl(XSLTTransformer.java:158)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
     at
org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
     at
org.orbeon.oxf.processor.converter.HTMLConverter.readInput(HTMLConverter.java:65)
     at
org.orbeon.oxf.processor.converter.TextConverterBase$1.readImpl(TextConverterBase.java:80)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
     at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
     at
org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
     at
org.orbeon.oxf.processor.serializer.HttpSerializer.readInput(HttpSerializer.java:42)
     at
org.orbeon.oxf.processor.serializer.HttpSerializerBase.start(HttpSerializerBase.java:175)
     at
org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647)
     at
org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:620)
     at
org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644)
     at
org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor.start(ConcreteChooseProcessor.java:251)
     at
org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647)
     at
org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:620)
     at
org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644)
     at org.orbeon.oxf.pipeline.InitUtils.runProcessor(InitUtils.java:90)
     at
org.orbeon.oxf.webapp.ProcessorService.service(ProcessorService.java:100)
     at
org.orbeon.oxf.servlet.OrbeonServletDelegate.service(OrbeonServletDelegate.java:138)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at
org.atombeat.http.SpringSecuritySetUserRequestAttributesFilter.doHttpFilter(SpringSecuritySetUserRequestAttributesFilter.java:106)
     at org.atombeat.http.HttpFilter.doFilter(HttpFilter.java:37)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:312)
     at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
     at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
     at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
     at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:95)
     at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
     at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
     at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
     at
org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:88)
     at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
     at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
     at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
     at
org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:62)
     at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
     at
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:196)
     at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
     at
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:93)
     at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
     at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:165)
     at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
     at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at
org.atombeat.http.HttpMethodOverrideFilter.doHttpFilter(HttpMethodOverrideFilter.java:32)
     at org.atombeat.http.HttpFilter.doFilter(HttpFilter.java:37)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
     at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
     at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
     at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:409)
     at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:662)



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Problems with file upload and extended characters

Erik Bruchez
Administrator
Ian,

Things could break in a couple of places. Do you have a complete
example that would show this?

-Erik

On Tue, Dec 6, 2011 at 1:54 AM, Ian Wright <[hidden email]> wrote:

> Hi,
>
> I'm trying to upload a file with extended characters e.g. é in the file
> name.
>
> It does work however the extended character is replaced with a ? which is
> not great. (Looking at the httpclient.wire.content I believe that it's
> Orbeon doing this rather than eXist)
>
> The ins-upload instance contains the correct value for the file name so as a
> work around I tried to do a put using that value however this results in a
> binding exception but only when there are extended characters in the name.
>
> Any ideas?
>
> Thanks,
> Ian
>
> <xforms:submission id="sub-after-upload" method="put"
>
>  resource="{instance('ins-uploaded-file')/atom:link[@rel='edit']/@href}"
>        ref="instance('ins-uploaded-file')"
>        replace="none"  mediatype="application/atom+xml"
>>
> <xforms:action ev:event="xforms-submit-done">
> <xforms:message level="modal">
>                Your file has been submitted. Thank you.
> </xforms:message>
> <!-- clear out upload -->
> <xforms:insert nodeset="instance('ins-upload')"
>                origin="instance('ins-upload-empty')" />
> <!-- refresh submitted media -->
> <xforms:send submission="sub-get-submitted-media-feed" />
>
> </xforms:action>
> </xforms:submission>
>
> <xforms:submission id="sub-post-upload" method="form-data-post"
>
>  resource="{instance('ins-study-entry')/atom:link[@rel='http://www.cggh.org/2010/chassis/terms/submittedMedia']/@href}"
>        ref="instance('ins-upload')" instance="ins-uploaded-file"
> replace="instance" >
>
> <xforms:header>
> <xforms:name>Accept</xforms:name>
> <xforms:value>application/atom+xml</xforms:value>
> </xforms:header>
>
> <xforms:action ev:event="xforms-submit-done">
>
> <xforms:setvalue ref="instance('ins-uploaded-file')//atom:title/text()"
> value="instance('ins-upload')//media/@filename"/>
>
> <xforms:send submission="sub-after-upload" />
>
> </xforms:action>
>
>
> <xforms:message ev:event="xforms-submit-error" level="modal">
>            An error occurred (
> <xforms:output value="event('error-type')" />
>            ) while posting an upload.
> </xforms:message>
>
> </xforms:submission>
>
> 2011-12-06 09:44:13,017 ERROR org.orbeon.oxf.webapp.ProcessorService  -
> Exception at
> org.orbeon.oxf.common.ValidationException: : Binding exception for target:
> sub-post-upload
> null, line -1, column -1: Binding exception for target: sub-post-upload
>    at
> org.orbeon.oxf.xforms.submission.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:299)
>    at
> org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1021)
>    at
> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
>    at
> org.orbeon.oxf.xforms.XFormsInstance.setValueForNodeInfo(XFormsInstance.java:376)
>    at
> org.orbeon.oxf.xforms.action.actions.XFormsSetvalueAction.doSetValue(XFormsSetvalueAction.java:111)
>    at
> org.orbeon.oxf.xforms.action.actions.XFormsSetvalueAction.execute(XFormsSetvalueAction.java:80)
>    at
> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runSingleIteration(XFormsActionInterpreter.java:295)
>    at
> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:256)
>    at
> org.orbeon.oxf.xforms.action.actions.XFormsActionAction.execute(XFormsActionAction.java:66)
>    at
> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runSingleIteration(XFormsActionInterpreter.java:295)
>    at
> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:256)
>    at
> org.orbeon.oxf.xforms.event.XFormsEventHandlerImpl.handleEvent(XFormsEventHandlerImpl.java:204)
>    at
> org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1000)
>    at
> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
>    at
> org.orbeon.oxf.xforms.submission.BaseReplacer$1.run(BaseReplacer.java:39)
>    at
> org.orbeon.oxf.xforms.submission.XFormsModelSubmission.doSubmit(XFormsModelSubmission.java:487)
>    at
> org.orbeon.oxf.xforms.submission.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:295)
>    at
> org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1021)
>    at
> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
>    at
> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEventCheckTarget(XFormsContainingDocument.java:925)
>    at
> org.orbeon.oxf.xforms.XFormsContainingDocument.handleExternalEvent(XFormsContainingDocument.java:905)
>    at
> org.orbeon.oxf.xforms.processor.XFormsServer.createAndDispatchEvents(XFormsServer.java:519)
>    at
> org.orbeon.oxf.xforms.processor.XFormsServer.doIt(XFormsServer.java:328)
>    at
> org.orbeon.oxf.xforms.processor.XFormsServer.access$000(XFormsServer.java:63)
>    at
> org.orbeon.oxf.xforms.processor.XFormsServer$1.readImpl(XFormsServer.java:94)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$ConcreteProcessorFilter$ForwarderProcessorOutput.read(ProcessorImpl.java:1046)
>    at
> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>    at
> org.orbeon.oxf.processor.validation.MSVValidationProcessor.access$600(MSVValidationProcessor.java:45)
>    at
> org.orbeon.oxf.processor.validation.MSVValidationProcessor$3.readImpl(MSVValidationProcessor.java:215)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$ConcreteProcessorFilter.read(ProcessorImpl.java:1070)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>    at
> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>    at
> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:450)
>    at
> org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer.access$900(XSLTTransformer.java:73)
>    at
> org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer$1.runTransformer(XSLTTransformer.java:359)
>    at
> org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer$1.readImpl(XSLTTransformer.java:158)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>    at
> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>    at
> org.orbeon.oxf.processor.converter.HTMLConverter.readInput(HTMLConverter.java:65)
>    at
> org.orbeon.oxf.processor.converter.TextConverterBase$1.readImpl(TextConverterBase.java:80)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>    at
> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>    at
> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>    at
> org.orbeon.oxf.processor.serializer.HttpSerializer.readInput(HttpSerializer.java:42)
>    at
> org.orbeon.oxf.processor.serializer.HttpSerializerBase.start(HttpSerializerBase.java:175)
>    at
> org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647)
>    at
> org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:620)
>    at
> org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644)
>    at
> org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor.start(ConcreteChooseProcessor.java:251)
>    at
> org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647)
>    at
> org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:620)
>    at
> org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644)
>    at org.orbeon.oxf.pipeline.InitUtils.runProcessor(InitUtils.java:90)
>    at
> org.orbeon.oxf.webapp.ProcessorService.service(ProcessorService.java:100)
>    at
> org.orbeon.oxf.servlet.OrbeonServletDelegate.service(OrbeonServletDelegate.java:138)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>    at
> org.atombeat.http.SpringSecuritySetUserRequestAttributesFilter.doHttpFilter(SpringSecuritySetUserRequestAttributesFilter.java:106)
>    at org.atombeat.http.HttpFilter.doFilter(HttpFilter.java:37)
>    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>    at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:312)
>    at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
>    at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
>    at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>    at
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:95)
>    at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>    at
> org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
>    at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>    at
> org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:88)
>    at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>    at
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
>    at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>    at
> org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:62)
>    at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>    at
> org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:196)
>    at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>    at
> org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:93)
>    at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>    at
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:165)
>    at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
>    at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>    at
> org.atombeat.http.HttpMethodOverrideFilter.doHttpFilter(HttpMethodOverrideFilter.java:32)
>    at org.atombeat.http.HttpFilter.doFilter(HttpFilter.java:37)
>    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>    at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>    at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>    at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>    at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>    at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>    at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>    at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
>    at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
>    at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:409)
>    at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>    at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>    at java.lang.Thread.run(Thread.java:662)
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problems with file upload and extended characters

idwright
Hi Erik,
I've attached a form - there's nothing special in there.
I've also attached a small test file.

The wire for the post from this is below - you can see that the filename
in the POST is "t?st.txt"

Thanks,
Ian

"POST /repository/service/content/sandbox HTTP/1.1[\r][\n]"
"Accept: application/atom+xml[\r][\n]"
"Cookie: JSESSIONID=5A86B7AD7C79BBDA99A501F4DC5D2D8A[\r][\n]"
"Content-Type: multipart/form-data;
boundary=rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ[\r][\n]"
"User-Agent: Jakarta Commons-HttpClient/3.1-rc1[\r][\n]"
"Host: kwiat33:8080[\r][\n]"
"Content-Length: 584[\r][\n]"
"[\r][\n]"
"--rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ[\r][\n]"
"Content-Disposition: form-data; name="summary"[\r][\n]"
"Content-Type: text/plain; charset=UTF-8[\r][\n]"
"Content-Transfer-Encoding: 8bit[\r][\n]"
"[\r][\n]"
"[\r][\n]"
"--rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ[\r][\n]"
"Content-Disposition: form-data; name="media"; filename="t?st.txt"[\r][\n]"
"Content-Type: text/plain; charset=ISO-8859-1[\r][\n]"
"Content-Transfer-Encoding: binary[\r][\n]"
"[\r][\n]"
"[\r][\n]"
"--rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ[\r][\n]"
"Content-Disposition: form-data; name="category"[\r][\n]"
"Content-Type: text/plain; charset=UTF-8[\r][\n]"
"Content-Transfer-Encoding: 8bit[\r][\n]"
"[\r][\n]"
"term="foo"; scheme="bar"; label="baz"[\r][\n]"
"--rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ--[\r][\n]"
Thanks,
Ian
On 19:59, Erik Bruchez wrote:

> Ian,
>
> Things could break in a couple of places. Do you have a complete
> example that would show this?
>
> -Erik
>
> On Tue, Dec 6, 2011 at 1:54 AM, Ian Wright<[hidden email]>  wrote:
>> Hi,
>>
>> I'm trying to upload a file with extended characters e.g. é in the file
>> name.
>>
>> It does work however the extended character is replaced with a ? which is
>> not great. (Looking at the httpclient.wire.content I believe that it's
>> Orbeon doing this rather than eXist)
>>
>> The ins-upload instance contains the correct value for the file name so as a
>> work around I tried to do a put using that value however this results in a
>> binding exception but only when there are extended characters in the name.
>>
>> Any ideas?
>>
>> Thanks,
>> Ian
>>
>> <xforms:submission id=ub-after-upload" method="put"
>>
>>   resource=instance('ins-uploaded-file')/atom:link[@rel='edit']/@href}"
>>         ref=nstance('ins-uploaded-file')"
>>         replace=one"  mediatype="application/atom+xml"
>> <xforms:action ev:event=forms-submit-done">
>> <xforms:message level=odal">
>>                 Your file has been submitted. Thank you.
>> </xforms:message>
>> <!-- clear out upload -->
>> <xforms:insert nodeset=nstance('ins-upload')"
>>                 origin=nstance('ins-upload-empty')" />
>> <!-- refresh submitted media -->
>> <xforms:send submission=ub-get-submitted-media-feed" />
>>
>> </xforms:action>
>> </xforms:submission>
>>
>> <xforms:submission id=ub-post-upload" method="form-data-post"
>>
>>   resource=instance('ins-study-entry')/atom:link[@rel='http://www.cggh.org/2010/chassis/terms/submittedMedia']/@href}"
>>         ref=nstance('ins-upload')" instance="ins-uploaded-file"
>> replace=nstance">
>>
>> <xforms:header>
>> <xforms:name>Accept</xforms:name>
>> <xforms:value>application/atom+xml</xforms:value>
>> </xforms:header>
>>
>> <xforms:action ev:event=forms-submit-done">
>>
>> <xforms:setvalue ref=nstance('ins-uploaded-file')//atom:title/text()"
>> value=nstance('ins-upload')//media/@filename"/>
>>
>> <xforms:send submission=ub-after-upload" />
>>
>> </xforms:action>
>>
>>
>> <xforms:message ev:event=forms-submit-error" level="modal">
>>             An error occurred (
>> <xforms:output value=vent('error-type')" />
>>             ) while posting an upload.
>> </xforms:message>
>>
>> </xforms:submission>
>>
>> 2011-12-06 09:44:13,017 ERROR org.orbeon.oxf.webapp.ProcessorService  -
>> Exception at
>> org.orbeon.oxf.common.ValidationException: : Binding exception for target:
>> sub-post-upload
>> null, line -1, column -1: Binding exception for target: sub-post-upload
>>     at
>> org.orbeon.oxf.xforms.submission.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:299)
>>     at
>> org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1021)
>>     at
>> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
>>     at
>> org.orbeon.oxf.xforms.XFormsInstance.setValueForNodeInfo(XFormsInstance.java:376)
>>     at
>> org.orbeon.oxf.xforms.action.actions.XFormsSetvalueAction.doSetValue(XFormsSetvalueAction.java:111)
>>     at
>> org.orbeon.oxf.xforms.action.actions.XFormsSetvalueAction.execute(XFormsSetvalueAction.java:80)
>>     at
>> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runSingleIteration(XFormsActionInterpreter.java:295)
>>     at
>> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:256)
>>     at
>> org.orbeon.oxf.xforms.action.actions.XFormsActionAction.execute(XFormsActionAction.java:66)
>>     at
>> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runSingleIteration(XFormsActionInterpreter.java:295)
>>     at
>> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:256)
>>     at
>> org.orbeon.oxf.xforms.event.XFormsEventHandlerImpl.handleEvent(XFormsEventHandlerImpl.java:204)
>>     at
>> org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1000)
>>     at
>> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
>>     at
>> org.orbeon.oxf.xforms.submission.BaseReplacer$1.run(BaseReplacer.java:39)
>>     at
>> org.orbeon.oxf.xforms.submission.XFormsModelSubmission.doSubmit(XFormsModelSubmission.java:487)
>>     at
>> org.orbeon.oxf.xforms.submission.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:295)
>>     at
>> org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1021)
>>     at
>> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
>>     at
>> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEventCheckTarget(XFormsContainingDocument.java:925)
>>     at
>> org.orbeon.oxf.xforms.XFormsContainingDocument.handleExternalEvent(XFormsContainingDocument.java:905)
>>     at
>> org.orbeon.oxf.xforms.processor.XFormsServer.createAndDispatchEvents(XFormsServer.java:519)
>>     at
>> org.orbeon.oxf.xforms.processor.XFormsServer.doIt(XFormsServer.java:328)
>>     at
>> org.orbeon.oxf.xforms.processor.XFormsServer.access$000(XFormsServer.java:63)
>>     at
>> org.orbeon.oxf.xforms.processor.XFormsServer$1.readImpl(XFormsServer.java:94)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$ConcreteProcessorFilter$ForwarderProcessorOutput.read(ProcessorImpl.java:1046)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>>     at
>> org.orbeon.oxf.processor.validation.MSVValidationProcessor.access$600(MSVValidationProcessor.java:45)
>>     at
>> org.orbeon.oxf.processor.validation.MSVValidationProcessor$3.readImpl(MSVValidationProcessor.java:215)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$ConcreteProcessorFilter.read(ProcessorImpl.java:1070)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:450)
>>     at
>> org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer.access$900(XSLTTransformer.java:73)
>>     at
>> org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer$1.runTransformer(XSLTTransformer.java:359)
>>     at
>> org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer$1.readImpl(XSLTTransformer.java:158)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>>     at
>> org.orbeon.oxf.processor.converter.HTMLConverter.readInput(HTMLConverter.java:65)
>>     at
>> org.orbeon.oxf.processor.converter.TextConverterBase$1.readImpl(TextConverterBase.java:80)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>>     at
>> org.orbeon.oxf.processor.serializer.HttpSerializer.readInput(HttpSerializer.java:42)
>>     at
>> org.orbeon.oxf.processor.serializer.HttpSerializerBase.start(HttpSerializerBase.java:175)
>>     at
>> org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:620)
>>     at
>> org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644)
>>     at
>> org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor.start(ConcreteChooseProcessor.java:251)
>>     at
>> org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647)
>>     at
>> org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:620)
>>     at
>> org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644)
>>     at org.orbeon.oxf.pipeline.InitUtils.runProcessor(InitUtils.java:90)
>>     at
>> org.orbeon.oxf.webapp.ProcessorService.service(ProcessorService.java:100)
>>     at
>> org.orbeon.oxf.servlet.OrbeonServletDelegate.service(OrbeonServletDelegate.java:138)
>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>     at
>> org.atombeat.http.SpringSecuritySetUserRequestAttributesFilter.doHttpFilter(SpringSecuritySetUserRequestAttributesFilter.java:106)
>>     at org.atombeat.http.HttpFilter.doFilter(HttpFilter.java:37)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:312)
>>     at
>> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
>>     at
>> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>     at
>> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:95)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>     at
>> org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>     at
>> org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:88)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>     at
>> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>     at
>> org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:62)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>     at
>> org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:196)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>     at
>> org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:93)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>     at
>> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:165)
>>     at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
>>     at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>     at
>> org.atombeat.http.HttpMethodOverrideFilter.doHttpFilter(HttpMethodOverrideFilter.java:32)
>>     at org.atombeat.http.HttpFilter.doFilter(HttpFilter.java:37)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>     at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>     at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>     at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>>     at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>     at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>     at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>>     at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
>>     at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
>>     at
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:409)
>>     at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>     at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>     at java.lang.Thread.run(Thread.java:662)
>>
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing
>> list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=lp
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

upload.xhtml (8K) Download Attachment
=?ISO-8859-1?Q?t=E9st=2Etxt?= (18 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problems with file upload and extended characters

marek2608
In reply to this post by idwright
Did you get that fixed?
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Problems with file upload and extended characters

idwright
In reply to this post by idwright
Hi,
I've tracked this down to HttpClient (3.1 - since I'm still on Orbeon 3.8)

The quick fix or the more detailed fix may more more appropriate
depending on where you're posting to.

Quick Fix:
In org.apache.commons.httpclient.methods.multipart  
FilePart.sendDispositionHeader the filename is written using
EncodingUtil.getAsciiBytes which is essentially
filename.getBytes("US-ASCII") so if this is changed to
EncodingUtil.getBytes(filename,"UTF-8") then the filename is sent correctly

More detailed explanation and more detailed fix

However be aware that if you do make this change then you are getting
into problems with non-compliance with the form-data rfc

see http://www.ietf.org/rfc/rfc1867.txt

The client application should make best
    effort to supply the file name; if the file name of the client's
    operating system is not in US-ASCII, the file name might be
    approximated or encoded using the method of RFC 1522.

so according to RFC 1522 I think it should be something like this:
out.write("=?UTF-8?Q?".getBytes("US-ASCII"));
out.write(EncodingUtil.getBytes(filename,"UTF-8"));
out.write("?=".getBytes("US-ASCII"));


I can't immediately tell if this is a problem with Orbeon 3.9 and hence
the later version of httpclient

Regards,
Ian
On 19:59, Ian Wright wrote:

> Hi Erik,
> I've attached a form - there's nothing special in there.
> I've also attached a small test file.
>
> The wire for the post from this is below - you can see that the
> filename in the POST is "t?st.txt"
>
> Thanks,
> Ian
>
> "POST /repository/service/content/sandbox HTTP/1.1[\r][\n]"
> "Accept: application/atom+xml[\r][\n]"
> "Cookie: JSESSIONID=5A86B7AD7C79BBDA99A501F4DC5D2D8A[\r][\n]"
> "Content-Type: multipart/form-data;
> boundary=rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ[\r][\n]"
> "User-Agent: Jakarta Commons-HttpClient/3.1-rc1[\r][\n]"
> "Host: kwiat33:8080[\r][\n]"
> "Content-Length: 584[\r][\n]"
> "[\r][\n]"
> "--rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ[\r][\n]"
> "Content-Disposition: form-data; name="summary"[\r][\n]"
> "Content-Type: text/plain; charset=UTF-8[\r][\n]"
> "Content-Transfer-Encoding: 8bit[\r][\n]"
> "[\r][\n]"
> "[\r][\n]"
> "--rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ[\r][\n]"
> "Content-Disposition: form-data; name="media";
> filename="t?st.txt"[\r][\n]"
> "Content-Type: text/plain; charset=ISO-8859-1[\r][\n]"
> "Content-Transfer-Encoding: binary[\r][\n]"
> "[\r][\n]"
> "[\r][\n]"
> "--rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ[\r][\n]"
> "Content-Disposition: form-data; name="category"[\r][\n]"
> "Content-Type: text/plain; charset=UTF-8[\r][\n]"
> "Content-Transfer-Encoding: 8bit[\r][\n]"
> "[\r][\n]"
> "term="foo"; scheme="bar"; label="baz"[\r][\n]"
> "--rfgr5_q4_m5nemj0k4CGwlZ7zeSw_OZ--[\r][\n]"
> Thanks,
> Ian
> On 19:59, Erik Bruchez wrote:
>> Ian,
>>
>> Things could break in a couple of places. Do you have a complete
>> example that would show this?
>>
>> -Erik
>>
>> On Tue, Dec 6, 2011 at 1:54 AM, Ian Wright<[hidden email]>  
>> wrote:
>>> Hi,
>>>
>>> I'm trying to upload a file with extended characters e.g. é in the file
>>> name.
>>>
>>> It does work however the extended character is replaced with a ?
>>> which is
>>> not great. (Looking at the httpclient.wire.content I believe that it's
>>> Orbeon doing this rather than eXist)
>>>
>>> The ins-upload instance contains the correct value for the file name
>>> so as a
>>> work around I tried to do a put using that value however this
>>> results in a
>>> binding exception but only when there are extended characters in the
>>> name.
>>>
>>> Any ideas?
>>>
>>> Thanks,
>>> Ian
>>>
>>> <xforms:submission id=ub-after-upload" method="put"
>>>
>>>   resource=instance('ins-uploaded-file')/atom:link[@rel='edit']/@href}"
>>>         ref=nstance('ins-uploaded-file')"
>>>         replace=one"  mediatype="application/atom+xml"
>>> <xforms:action ev:event=forms-submit-done">
>>> <xforms:message level=odal">
>>>                 Your file has been submitted. Thank you.
>>> </xforms:message>
>>> <!-- clear out upload -->
>>> <xforms:insert nodeset=nstance('ins-upload')"
>>>                 origin=nstance('ins-upload-empty')" />
>>> <!-- refresh submitted media -->
>>> <xforms:send submission=ub-get-submitted-media-feed" />
>>>
>>> </xforms:action>
>>> </xforms:submission>
>>>
>>> <xforms:submission id=ub-post-upload" method="form-data-post"
>>>
>>>  
>>> resource=instance('ins-study-entry')/atom:link[@rel='http://www.cggh.org/2010/chassis/terms/submittedMedia']/@href}"
>>>         ref=nstance('ins-upload')" instance="ins-uploaded-file"
>>> replace=nstance">
>>>
>>> <xforms:header>
>>> <xforms:name>Accept</xforms:name>
>>> <xforms:value>application/atom+xml</xforms:value>
>>> </xforms:header>
>>>
>>> <xforms:action ev:event=forms-submit-done">
>>>
>>> <xforms:setvalue ref=nstance('ins-uploaded-file')//atom:title/text()"
>>> value=nstance('ins-upload')//media/@filename"/>
>>>
>>> <xforms:send submission=ub-after-upload" />
>>>
>>> </xforms:action>
>>>
>>>
>>> <xforms:message ev:event=forms-submit-error" level="modal">
>>>             An error occurred (
>>> <xforms:output value=vent('error-type')" />
>>>             ) while posting an upload.
>>> </xforms:message>
>>>
>>> </xforms:submission>
>>>
>>> 2011-12-06 09:44:13,017 ERROR org.orbeon.oxf.webapp.ProcessorService  -
>>> Exception at
>>> org.orbeon.oxf.common.ValidationException: : Binding exception for
>>> target:
>>> sub-post-upload
>>> null, line -1, column -1: Binding exception for target: sub-post-upload
>>>     at
>>> org.orbeon.oxf.xforms.submission.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:299)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1021)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.XFormsInstance.setValueForNodeInfo(XFormsInstance.java:376)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.action.actions.XFormsSetvalueAction.doSetValue(XFormsSetvalueAction.java:111)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.action.actions.XFormsSetvalueAction.execute(XFormsSetvalueAction.java:80)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runSingleIteration(XFormsActionInterpreter.java:295)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:256)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.action.actions.XFormsActionAction.execute(XFormsActionAction.java:66)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runSingleIteration(XFormsActionInterpreter.java:295)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:256)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.event.XFormsEventHandlerImpl.handleEvent(XFormsEventHandlerImpl.java:204)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1000)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.submission.BaseReplacer$1.run(BaseReplacer.java:39)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.submission.XFormsModelSubmission.doSubmit(XFormsModelSubmission.java:487)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.submission.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:295)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.xbl.XBLContainer.dispatchEvent(XBLContainer.java:1021)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:1010)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEventCheckTarget(XFormsContainingDocument.java:925)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.XFormsContainingDocument.handleExternalEvent(XFormsContainingDocument.java:905)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.processor.XFormsServer.createAndDispatchEvents(XFormsServer.java:519)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.processor.XFormsServer.doIt(XFormsServer.java:328)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.processor.XFormsServer.access$000(XFormsServer.java:63)
>>>
>>>     at
>>> org.orbeon.oxf.xforms.processor.XFormsServer$1.readImpl(XFormsServer.java:94)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$ConcreteProcessorFilter$ForwarderProcessorOutput.read(ProcessorImpl.java:1046)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>>>
>>>     at
>>> org.orbeon.oxf.processor.validation.MSVValidationProcessor.access$600(MSVValidationProcessor.java:45)
>>>
>>>     at
>>> org.orbeon.oxf.processor.validation.MSVValidationProcessor$3.readImpl(MSVValidationProcessor.java:215)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$ConcreteProcessorFilter.read(ProcessorImpl.java:1070)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:450)
>>>
>>>     at
>>> org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer.access$900(XSLTTransformer.java:73)
>>>
>>>     at
>>> org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer$1.runTransformer(XSLTTransformer.java:359)
>>>
>>>     at
>>> org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer$1.readImpl(XSLTTransformer.java:158)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>>>
>>>     at
>>> org.orbeon.oxf.processor.converter.HTMLConverter.readInput(HTMLConverter.java:65)
>>>
>>>     at
>>> org.orbeon.oxf.processor.converter.TextConverterBase$1.readImpl(TextConverterBase.java:80)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:1092)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1238)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:445)
>>>
>>>     at
>>> org.orbeon.oxf.processor.serializer.HttpSerializer.readInput(HttpSerializer.java:42)
>>>
>>>     at
>>> org.orbeon.oxf.processor.serializer.HttpSerializerBase.start(HttpSerializerBase.java:175)
>>>
>>>     at
>>> org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:620)
>>>
>>>     at
>>> org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644)
>>>
>>>     at
>>> org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor.start(ConcreteChooseProcessor.java:251)
>>>
>>>     at
>>> org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647)
>>>
>>>     at
>>> org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:620)
>>>
>>>     at
>>> org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644)
>>>
>>>     at
>>> org.orbeon.oxf.pipeline.InitUtils.runProcessor(InitUtils.java:90)
>>>     at
>>> org.orbeon.oxf.webapp.ProcessorService.service(ProcessorService.java:100)
>>>
>>>     at
>>> org.orbeon.oxf.servlet.OrbeonServletDelegate.service(OrbeonServletDelegate.java:138)
>>>
>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>>     at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>>
>>>     at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>
>>>     at
>>> org.atombeat.http.SpringSecuritySetUserRequestAttributesFilter.doHttpFilter(SpringSecuritySetUserRequestAttributesFilter.java:106)
>>>
>>>     at org.atombeat.http.HttpFilter.doFilter(HttpFilter.java:37)
>>>     at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>
>>>     at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:312)
>>>
>>>     at
>>> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
>>>
>>>     at
>>> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>>
>>>     at
>>> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:95)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>>
>>>     at
>>> org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>>
>>>     at
>>> org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:88)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>>
>>>     at
>>> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>>
>>>     at
>>> org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:62)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>>
>>>     at
>>> org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:196)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>>
>>>     at
>>> org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:93)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
>>>
>>>     at
>>> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:165)
>>>
>>>     at
>>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
>>>
>>>     at
>>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>>>
>>>     at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>
>>>     at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>
>>>     at
>>> org.atombeat.http.HttpMethodOverrideFilter.doHttpFilter(HttpMethodOverrideFilter.java:32)
>>>
>>>     at org.atombeat.http.HttpFilter.doFilter(HttpFilter.java:37)
>>>     at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>
>>>     at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>
>>>     at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>>
>>>     at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>>
>>>     at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>>>
>>>     at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>
>>>     at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>>
>>>     at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>>>
>>>     at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
>>>
>>>     at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
>>>
>>>     at
>>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:409)
>>>
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>
>>>     at java.lang.Thread.run(Thread.java:662)
>>>
>>>
>>>
>>> --
>>> You receive this message as a subscriber of the [hidden email]
>>> mailing
>>> list.
>>> To unsubscribe: mailto:[hidden email]
>>> For general help: mailto:[hidden email]?subject=lp
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws