Problem .Zip File Corrupted after FTP Transfer

  • In my job I take zip files that are provided to me via ftp,

    for all zip files the job decompresses the file and then processes the text file that is inside,

    I realized that the job was no longer running correctly when in the folder where I receive the .Zip files the files had not yet been unpacked, I realized that the file in question was corrupt only by opening each zip file in the folder one at a time .

    The job did not go into error because the Pkzip service I use to unpack the file remains running and for this reason the job kept running indefinitely.

    how do i know if the .zip file in question is corrupt? if I succeed, how can I terminate the job highlighting that the job has ended due to the corrupt file?

    this is the code snippet where the job goes in an infinite loop due to the service still running:

    SET @UNZIP = 'Pkzipc -extr=up '+ @Path +'\'+ @FILE + ' ' +@Path
    EXEC MASTER..XP_CMDSHELL @UNZIP

     

     

  • One thing I can think of is to set up an alert which detects 'long running jobs'. There are many ways of doing this, but one is to have another job which runs periodically, performs a scan and provides appropriate feedback in the event it finds a job deemed to be running longer than acceptable.

    Or is your question "How can I determine in advance whether a specific Zip file is in the correct format?" To answer this, I'd like to know more about the nature of the 'corruption' which you refer to. Have you determined exactly what is going wrong? As this is (presumably) quite a regular occurrence, there is likely to be a systemic explanation for the problem.


  • I would work with a few zip utilities and see what results you get from the command line. This might help you determine when something is broken in the transfer.

  • The FTP-transfer is still binary ? (corruption with non-binary transfer)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply