revzip lib

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
lmsix
Posts: 1
Joined: Mon Mar 28, 2011 9:38 am

revzip lib

Post by lmsix » Mon Mar 28, 2011 9:48 am

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.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: revzip lib

Post by Dixie » Mon Mar 28, 2011 10:53 am

Imsix...

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

Dixie

trevix
Posts: 1079
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

revZipAddItemWithFile problems on Windows 7

Post by trevix » Fri Nov 02, 2012 8:20 pm

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
Trevix
OSX 14.6.1 xCode 15 LC 10 RC1 iOS 15> Android 7>

trevix
Posts: 1079
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Re: revzip lib SOLVED

Post by trevix » Sat Nov 03, 2012 11:36 am

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
Trevix
OSX 14.6.1 xCode 15 LC 10 RC1 iOS 15> Android 7>

Post Reply