HB_UnzipFile Does not work (SOLVED Thank you ENRICO)

Post Reply
User avatar
Armando
Posts: 3275
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

HB_UnzipFile Does not work (SOLVED Thank you ENRICO)

Post 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 :oops:

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
Last edited by Armando on Sun Feb 26, 2023 6:12 pm, edited 2 times in total.
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Enrico Maria Giordano
Posts: 8761
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: HB_UnzipFile Does not work

Post by Enrico Maria Giordano »

Please check the content of aFiles and report back.
User avatar
Armando
Posts: 3275
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

Re: HB_UnzipFile Does not work

Post 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
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Enrico Maria Giordano
Posts: 8761
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: HB_UnzipFile Does not work

Post by Enrico Maria Giordano »

Can I have the ZIP file to make a test here?
User avatar
Armando
Posts: 3275
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

Re: HB_UnzipFile Does not work

Post 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
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Enrico Maria Giordano
Posts: 8761
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: HB_UnzipFile Does not work

Post by Enrico Maria Giordano »

Ok, 7-zip reports "Headers error". So it is a corrupted ZIP file.
User avatar
Armando
Posts: 3275
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

Re: HB_UnzipFile Does not work

Post by Armando »

Enrico:

I understand, I open it with Winrar and there are no error reports

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
Posts: 3275
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

Re: HB_UnzipFile Does not work

Post by Armando »

Enrico:

I have downloaded 7-Zip to open the ZIP file and I have no problems at all

Best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Enrico Maria Giordano
Posts: 8761
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: HB_UnzipFile Does not work

Post by Enrico Maria Giordano »

Please open the ZIP file with 7-Zip and look at File Menu and Properties item.
User avatar
Enrico Maria Giordano
Posts: 8761
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: HB_UnzipFile Does not work

Post by Enrico Maria Giordano »

I just extract the files and re-zip them and now it works properly.
User avatar
Armando
Posts: 3275
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

Re: HB_UnzipFile Does not work

Post by Armando »

Enrico:

Can I have your new Zip file?, I'll try with it.

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
Posts: 3275
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

Re: HB_UnzipFile Does not work

Post by Armando »

Enrico:

Yes you are right, there is an error.

Pls do not send me your zip file.

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
Posts: 3275
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

Re: HB_UnzipFile Does not work (SOLVED)

Post by Armando »

Enrico:

Now all is fine.

Thank you very much.

With best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Post Reply