You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Copernico <en...@gmail.com> on 2015/05/27 14:49:34 UTC

FTP Downloading get corrupted files

Hi!

I'm using Camel FTP2 to download ZIP files from remote ftp server.
Sometimes, downloaded files get corrupted. This occurs randomly. I know they
are corrupted because when i try to unzip their content and i get an error
during extraction. But when i download the same file with a ftp client like
FileZilla or another, i can extract the content without trouble. There is a
way to check (md5 checksum for example) if downloaded files are OK? and in
case aren't ok: how do i retry the download?

Thanks  regards



--
View this message in context: http://camel.465427.n5.nabble.com/FTP-Downloading-get-corrupted-files-tp5767530.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: FTP Downloading get corrupted files

Posted by Ravindra Godbole <go...@gmail.com>.
You can write bean to do the checksum. It will throw exception and the file
will not be downloaded. Off course you will have to take care of ' how many
times to retry logic ' !

Like ....

   <route>
            <from uri="ftp://test@xx.xx.xx.xx
?password=test&amp;binary=true&amp;delay=6000&amp;move=.done"/>
             <to uri="bean:checkSum"/>    <!-- Check for file integrity -->
             <to uri="file://target/testfiles"/>

      </route>


On Wed, May 27, 2015 at 6:19 PM, Copernico <en...@gmail.com> wrote:

> Hi!
>
> I'm using Camel FTP2 to download ZIP files from remote ftp server.
> Sometimes, downloaded files get corrupted. This occurs randomly. I know
> they
> are corrupted because when i try to unzip their content and i get an error
> during extraction. But when i download the same file with a ftp client like
> FileZilla or another, i can extract the content without trouble. There is a
> way to check (md5 checksum for example) if downloaded files are OK? and in
> case aren't ok: how do i retry the download?
>
> Thanks  regards
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/FTP-Downloading-get-corrupted-files-tp5767530.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
- Ravi

*[ View My Youtube Channel
<https://www.youtube.com/playlist?list=PL5Y_TlNjh0D59A4K3yQQR7gNAslnxDmRB>
]*

Phone: +91 *98 509 760 91*

Re: FTP Downloading get corrupted files

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I am not aware of any way of checking if the download was corrupt?

You may need to check the commons net ftp library to see if there is
any kind of support or way of doing this?

If you use the ftp from a camel route, you could later add some code
that does the validation and if there is a problem, then it throws an
exception, then the exchange is rolled back, and the ftp will
re-download from next poll.

On Wed, May 27, 2015 at 2:49 PM, Copernico <en...@gmail.com> wrote:
> Hi!
>
> I'm using Camel FTP2 to download ZIP files from remote ftp server.
> Sometimes, downloaded files get corrupted. This occurs randomly. I know they
> are corrupted because when i try to unzip their content and i get an error
> during extraction. But when i download the same file with a ftp client like
> FileZilla or another, i can extract the content without trouble. There is a
> way to check (md5 checksum for example) if downloaded files are OK? and in
> case aren't ok: how do i retry the download?
>
> Thanks  regards
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/FTP-Downloading-get-corrupted-files-tp5767530.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/