Page 1 of 1

revzip lib

Posted: Mon Mar 28, 2011 9:48 am
by lmsix
Hello,

I am new to LiveCode and I am struggling to using the revZip library.
Here is what I try to achieve :

I use the GET command to access a http URL.
I receive the answer to the GET command in the "IT" variable.
The Web server is sending me a zip stream (option" Content-Encoding"; "deflate" in the http header, this option is supported by almost all modern browsers).
I have tried to access this URL with Firefox and it works well, firefox deflates the data automatically.

I can't decompress this stream with LiveCode.
I have tried to store this stream in a binary file but the file is unreadable.

Anyone has an idea how to compress this stream ?

Thanks in advance.

Re: revzip lib

Posted: Mon Mar 28, 2011 10:53 am
by Dixie
Imsix...

have a look at...
http://www.runrev.com/developers/lesson ... -zip-tool/
be well

Dixie

revZipAddItemWithFile problems on Windows 7

Posted: Fri Nov 02, 2012 8:20 pm
by trevix
I downloaded the Zip/Unzip stack at:
http://www.runrev.com/developers/lesson ... -zip-tool/

I modified it try to make it zip and unzip "empty" folders too.
It works on OSX (10.5.8 and 10.6.8) but on Windows 7 it refuses to zip empty folders (it unzip fine).
Sometimes it crashes Livecode (5.5.3) if you put a directory to folder in the "pFile" (directory to the file).
What am I missing ?

I uploaded the stack in the UserSamples section under the name "TheRevZipper" if anyone can take a look...
Thanks

Trevix

Re: revzip lib SOLVED

Posted: Sat Nov 03, 2012 11:36 am
by trevix
As usual, after a night sleep, I found the solution:
for folders, I changed the "revZipAddItemWithFile" with a "revZipAddItemWithData", after having added a "local ProvVar" on the script.

Code: Select all

 repeat for each line tFolder in the folders
       if tFolder is among the items of "./.." then next repeat
       revZipAddItemWithData pArchive, pPrefix & item -1 of pFolder & "/" & tFolder & "/", "ProvVar"
       MayBeError the result
        addFolderToArchive pArchive, pFolder & "/" & tFolder, pPrefix & item -1 of pFolder & "/"
    end repeat
Now works both on OSX and Windows 7.

Trevix