Page 1 of 1

Inflating ZIP Deflated data string

Posted: Fri Jun 14, 2013 9:36 pm
by daryl
Hi Folks,

I asked this a little while back and was referred to the revZip functions, however after reviewing the documentation (there does not appear to be much beyond what is in the dictionary) and playing with the functions I'm not sure this is the way to go. The revZip functions seem to only work with file based zip archives, my data is in a buffer read from a network socket, and has been zip deflated by the server I get it from. I did try writing the following with my data:

put "/my/path/to/archive.zip" into tArchive
revZipOpenArchive tArchive, "write"
revZipAddUncompressedItemWithData tArchive, "myZippedItem", "thePayload"
revZipCloseArchive tArchive
revZipOpenArchive tArchive, "read"
revZipExtractItemToVariable tArchive, "myZippedItem", "tDeflated"

However it's still compressed after extracting to tDeflated. If anyone has experience using these functions, I could sure use some help. It is hard to believe that there is no interface beyond revZip to the libzip library. I am trying to translate a perl script to LiveCode and give it a GUI. This whole deflate business takes one line in the perl script, using their Compress::Zlib interface.

I did stumble across a site on github where there perhaps appears to be some integration work being done by RunRevMark at: https://github.com/runrev/livecode-thir ... ter/libzip, If anyone knows more about this I would really like to know if there are any plans to extend the LiveCode interface to the libzip library.

If I am unable to figure out how to inflate this network read data it may be a deal killer and my boss will have me using Adobe Air or something. Any help would be greatly appreciated.

Thanks,

Daryl

Re: Inflating ZIP Deflated data string

Posted: Mon Feb 02, 2015 7:15 am
by Tribblehunter
Did anyone get anywhere with this? I am having the same problem.

Re: Inflating ZIP Deflated data string

Posted: Thu Feb 05, 2015 5:21 pm
by MaxV

Re: Inflating ZIP Deflated data string

Posted: Thu Feb 05, 2015 10:12 pm
by Tribblehunter
Managed to get my problem sorted.

Was not a zip problem. Just needed to decompress file.

Code: Select all

put decompress (it) into tHtmlpage
in this thread. http://forums.livecode.com/viewtopic.php?f=7&t=16602