upload file .xlsx file in to ftp folder gets corrupted using apache camel

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

upload file .xlsx file in to ftp folder gets corrupted using apache camel

bsurya1989
Hi,

I am trying to upload a Excel(.xlsx) file using apache camel.
The file gets corrupted after its been transferred to ftp folder.

My code snippet is as simple as below

<routeContext xmlns="http://camel.apache.org/schema/spring" id="excel-camel-route-context">
        <route id="excel-camel-route" trace="true">

            <from uri="file://D:/template/cms?include=.*.xlsx&delete=true"/>

            <to uri="ftp://srvsoltm:XXXX@dhtbfp01/dhpdna01-b2b-test/Excel_file_received?disconnect=true"/>

        </route>
</routeContext>

The file gets transferred but is not readable. It says "Excel found unreadable content in file"

Please if anyone has any idea to transfer an Excel(.xlsx) file to FTP let me know.

Kind Regards,
Surya.
Reply | Threaded
Open this post in threaded view
|

Re: upload file .xlsx file in to ftp folder gets corrupted using apache camel

bsurya1989
Hi,

Got the solution.

Please add another attribute for this "binary=true".

<to uri="ftp://srvsoltm:XXXX@dhtbfp01/dhpdna01-b2b-test/Excel_file_received?disconnect=true&binary=true"/>

This will work fine..

Kind Regards,
Surya.