This topic contains 1 reply, has 2 voices, and was last updated by  Jeff Drumm 2 years, 6 months ago.

Corrupt pdf documents after SFTP

  • Some of the documents are getting uploaded in an unreadable form. This is what I’m doing:

    SftpConn = net.sftp.init{server=P.IP,username=P.User,password=P.Pass,live=true}
    ok = SftpConn:put{local_path=FileLoc,remote_path=P.Dest..FileId,overwrite=true,debug=true}

    There’s plenty of space on the server. How can I verify that the put worked? And that the whole pdf document got there? Is there any way in my code to verify that the document I received is whole? Should I be ftping to one location, then moving the document to the location being monitored in case the other system is downloading before the document is complete? Since every document isn’t corrupt, I don’t know where this is breaking down.

    FTP is not my choice for sending data.

    Best practice for file transfer of any sort is to have the source system ‘put’ the file to a temporary location (or name), then move/rename the file to its intended destination after completion of the transfer. It sounds like you have two opportunities for an incomplete transfer; once when the file is delivered to you for processing through Iguana, and again when the file is handed off to the destination system.

    I’d start with the system that is delivering the file to you and make sure it’s using a mechanism that guarantees the file is complete before it’s exposed to the Iguana retrieval process. I would also strongly recommend that for your delivery to the target system, the file is delivered to a temporary name/location initially, then moved/renamed to its final location or name after transfer.

    Once those variables are dealt with, you can be fairly confident that you’re at least delivering exactly what you received, and can then look for other culprits if the corruption is still apparent.

    Jeff Drumm ◊ VP and COO ◊ HICG, LLC. ◊


You must be logged in to reply to this topic.