[Solved] ZipExtractFiles not working as expected

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ocnuybear
Pro Scripter
Posts: 100
Joined: Sun Jul 15, 2018 5:14 pm

[Solved] ZipExtractFiles not working as expected

Post by ocnuybear » Mon Jul 16, 2018 7:47 am

Hi There,

I'm trying to extract a zipped file from "C:\FTP" which name that is not constant to "C:\FTP\Unzipped\", but it is not unzipping it - please help?

The zipped file contains an xlsx file.

Code: Select all

ZipExtractFiles>C:\FTP\*.ZIP,*.xlsx,C:\FTP\Unzipped\,Err1
Last edited by ocnuybear on Tue Jul 17, 2018 5:42 am, edited 1 time in total.

ocnuybear
Pro Scripter
Posts: 100
Joined: Sun Jul 15, 2018 5:14 pm

Re: ZipExtractFiles not working as expected

Post by ocnuybear » Mon Jul 16, 2018 8:56 am

Looping through the files is also not unzipping although the message displays the correct path & name:

What does filespec mean ? - have tried many different filespec like *.xslx *.* but nothing works

Code: Select all

GetFileList>c:\FTP\*.zip,strFileList,;
Separate>strFileList,;,file_names
if>file_names_count=0
  Input>strInputResult,"No Files was found"
  Exit>0
ENDIF

Let>k=0
Repeat>k
  Let>k=k+1
  Input>file_names_%k%
  ZipExtractFiles>file_names_%k%,,C:\FTP\Unzipped,Err1
Until>k,file_names_count

ocnuybear
Pro Scripter
Posts: 100
Joined: Sun Jul 15, 2018 5:14 pm

Re: ZipExtractFiles not working as expected

Post by ocnuybear » Tue Jul 17, 2018 5:42 am

I figured out what the problem was, I'm pulling files from FTP server with

Code: Select all

FTPGetFile>IP,USER,PASS,21,c:\FTP\,/Documents/,*.zip,I
But I had the switch at the end set to A which resulted in corrupt zip files being transferred & when changing this to I meaning Passive Mode it did not corrupt the files anymore and ZipExtractFiles is working as expected now :D

One should also check the output from ZipExtractFiles to check that it is 0:

Code: Select all

ZipExtractFiles>file_names_%k%,*.xlsx,C:\FTP\Unzipped,Err

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts