Question

I have the below flow

<file:endpoint 
    name="StartPoint" 
    path="C:\input" 
    pollingFrequency="5000" 
    doc:name="File"/>


    <flow name="fileUploader" doc:name="fileUploader">

        <quartz:inbound-endpoint 
        jobName="myServiceJob" 
        repeatInterval="5000" 
        doc:name="Quartz" 
        responseTimeout="10000">

            <quartz:endpoint-polling-job>
        <quartz:job-endpoint ref="StartPoint"/>
        </quartz:endpoint-polling-job>
       </quartz:inbound-endpoint>       

    <!--<object-to-byte-array-transformer doc:name="Object to Byte Array"/> -->

     <file:outbound-endpoint 
        path="C:\outputfile" 
        responseTimeout="10000" 
        doc:name="File"/>

    </flow>

Now suppose, I have some files say (1.txt,2.txt, myimg.jpg etc.) in the "C:\input".

enter image description here

While I run the flow, though the file transfer happens to the destination folder "C:\outputfile", but the file are getting converted to dat files.

enter image description here

So what is the problem and how to solve it?

Thanks in advance

Was it helpful?

Solution

The problem is that Mule is naming the files after the message's id property. To solve this use

<file:outbound-endpoint 
  path="C:\outputfile" 
  outputPattern="#[message.inboundProperties['originalFilename']]"
  responseTimeout="10000"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top