Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Francois,
I don't think the tFileUnarchive component, as standard, will allow you to do what you want. The only semi-sensible solution I could come up with, was to enable the "Use archive file name as root directory" option, then once the component has unzipped the archive, successfully or not, is to then check the number of files in the resulting sub-directory. If this is 0, then the archive was corrupt/unzippable.
Thanks
David
Old thread, but I had a similar issue. Solved it by using an iterate. Since tFileUnarchive will only iterate if it unzips something, you can hang a tJava off of it, and set some variable like "GoodZip" which then only gets set if it found unzipped at least one file.
Hi all
I still have the same issue, and can't find my way around it. Althouth the iterate solution seems to work, it has two problems:
In my case, I am downloading a zip file from and FTP server, extracting the content, processing a json file which is inside and then creating and emailing an excel file. Now, if the zip file is corrupted, I have no view of that, which is what I am after.
Any new ideas?
Thanks
@offcourse2 -- you're correct.
For #1, I solved this by hanging a tJava off of the iterate that sets a "GoodZip" global variable to true. It doesn't matter whether that sets it to true 200 times. You can then hang your real logic off of a RunIf that checks for the GoodZip variable, and it will only run once.
For #2, maybe you create another RunIf where if the zip file exists, but "GoodZip" is false (i.e. it never iterated), than the file must be corrupt. Just a thought.