Page 1 of 1
HB_UnzipFile Does not work (SOLVED Thank you ENRICO)
Posted: Sun Feb 26, 2023 3:03 am
by Armando
Hello friends of the forum:
I have spent several days trying to extract 900 files from a ZIP file with the following code
that I searched and copied from the forum but it doesn't work for me
Code: Select all | Expand
lMkDir( cDirGlb) <=== yes the folder is created correctly
aFiles := hb_GetFilesInZip(cPathFile,(.T.))
IF hb_UnzipFile( cPathFile,,,,cDriGlb,aFiles,nil)
? "Very Good"
ELSE
? "Failed"
ENDIF
And it doesn't unzip it, what am I doing wrong?
Best regards
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 11:17 am
by Enrico Maria Giordano
Please check the content of aFiles and report back.
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 11:43 am
by Armando
Enrico:
Thanks for your advice, with ? LEN(aFiles) I got a number 5 and
yes, the zip file has five files in.
With
FOR nVez := 1 TO Len(aFilInZip)
? aFilInZip[nVez]
NEXT
I got five five files name
My tools FWH2013 & Harbour
Best regards
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 1:02 pm
by Enrico Maria Giordano
Can I have the ZIP file to make a test here?
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 5:11 pm
by Armando
Enrico:
I just sent you a zip file to
e.m.giordano@emagsoftware.it address.
The zip file has five records only.
I really appreciate your help
Best regards
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 5:19 pm
by Enrico Maria Giordano
Ok, 7-zip reports "Headers error". So it is a corrupted ZIP file.
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 5:28 pm
by Armando
Enrico:
I understand, I open it with Winrar and there are no error reports
Regards
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 5:36 pm
by Armando
Enrico:
I have downloaded 7-Zip to open the ZIP file and I have no problems at all
Best regards
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 5:38 pm
by Enrico Maria Giordano
Please open the ZIP file with 7-Zip and look at File Menu and Properties item.
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 5:38 pm
by Enrico Maria Giordano
I just extract the files and re-zip them and now it works properly.
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 5:47 pm
by Armando
Enrico:
Can I have your new Zip file?, I'll try with it.
Regards
Re: HB_UnzipFile Does not work
Posted: Sun Feb 26, 2023 5:52 pm
by Armando
Enrico:
Yes you are right, there is an error.
Pls do not send me your zip file.
Regards
Re: HB_UnzipFile Does not work (SOLVED)
Posted: Sun Feb 26, 2023 6:12 pm
by Armando
Enrico:
Now all is fine.
Thank you very much.
With best regards
Re: HB_UnzipFile Does not work (SOLVED Thank you ENRICO)
Posted: Sun Feb 26, 2023 6:27 pm
by Enrico Maria Giordano
You're welcome.