Announcement Announcement Module
No announcement yet.
sftp:outbound-channel-adapter is corrupting zip files during copy to remote machine Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • sftp:outbound-channel-adapter is corrupting zip files during copy to remote machine

    Hi All,
    i'm using sftp adapter to copy zip files from one to another unix machines. in some cases the copied file in destination is not copied completely and been corrupted.

    the unzip error is:

    End-of-central-directory signature not found. Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive. In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
    attached a sample of corrupted file...

    my configuration is:

    	<bean id="sftpSessionFactory"
    		<property name="host" value="localhost" />
    		<property name="port" value="22" />
    		<property name="user" value="user1" />
    		<property name="password" value="pass1" />
    	<int-file:inbound-channel-adapter id="DataOutboundFileAdapter"
    		directory="${data.outbound}" channel="DataOutByteChannelIN"
    		id="DataSftpOutboundAdapter" session-factory="sftpSessionFactory"
    		channel="DataOutByteChannelIN" remote-file-separator="/"
    		auto-create-directory="false" remote-directory="${data.location}"
    		temporary-file-suffix="temp" />
    please advice,

  • #2
    How do files arrive in ${data.outbound}?

    It is a common mistake to write files with their final name directly; this can cause a partial file to be picked up before it is fully written.

    Many systems use a technique similar to our outbound adapters, where the file is written with a temporary file sufiix (e.g. and then renamed to its final name ( after it is completely written.

    With appropriate filters, the inbound adapter won't see the partial files, just the complete ones.


    • #3
      Thanks Gary,
      I'm archiving it manualy directly to this location. i will try your suggestion.


      • #4
        Thanks Gary !!!
        the issue resolved, after generating teh files with tmp suffix just after completion renamed to final name and now it seems to be working fine.